Package: groovy.io

## [Java] Class GroovyPrintStream

- groovy.io.GroovyPrintStream

-     public class GroovyPrintStream
      extends PrintStream

  A PrintStream that outputs objects in Groovy style. That means print(Object) uses InvokerHelper.toString(Object) to produce the same results as Writer.print(Object).

  Since:
    1.6

- - ### Constructor Summary

    Constructors
    Constructor and description
    `GroovyPrintStream(OutputStream out)` Creates a new print stream.
    `GroovyPrintStream(OutputStream out, boolean autoFlush)` Creates a new print stream.
    `GroovyPrintStream(OutputStream out, boolean autoFlush, String encoding)` Creates a new print stream.
    `GroovyPrintStream(String fileName)` Creates a new print stream, without automatic line flushing, with the specified file name.
    `GroovyPrintStream(String fileName, String csn)` Creates a new print stream, without automatic line flushing, with the specified file name and charset.
    `GroovyPrintStream(File file)` Creates a new print stream, without automatic line flushing, with the specified file.
    `GroovyPrintStream(File file, String csn)` Creates a new print stream, without automatic line flushing, with the specified file and charset.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `print(Object obj)` Prints an object Groovy style.
    `` | `public void` | `println(Object obj)` Prints an object Groovy style followed by a newline.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class PrintStream` | `append, append, append, append, append, append, checkError, close, equals, flush, format, format, getClass, hashCode, notify, notifyAll, nullOutputStream, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, toString, wait, wait, wait, write, write, write, writeBytes`

- - ### Constructor Detail

    - #### public GroovyPrintStream(OutputStream out)

      Creates a new print stream. This stream will not flush automatically.

      See Also:
        PrintStream.PrintStream

    - #### public GroovyPrintStream(OutputStream out, boolean autoFlush)

      Creates a new print stream.

      See Also:
        PrintStream.PrintStream

    - #### public GroovyPrintStream(OutputStream out, boolean autoFlush, String encoding)

      Creates a new print stream.

      See Also:
        PrintStream.PrintStream

    - #### public GroovyPrintStream(String fileName)

      Creates a new print stream, without automatic line flushing, with the specified file name.

      See Also:
        PrintStream.PrintStream

    - #### public GroovyPrintStream(String fileName, String csn)

      Creates a new print stream, without automatic line flushing, with the specified file name and charset.

      See Also:
        PrintStream.PrintStream

    - #### public GroovyPrintStream(File file)

      Creates a new print stream, without automatic line flushing, with the specified file.

      See Also:
        PrintStream.PrintStream

    - #### public GroovyPrintStream(File file, String csn)

      Creates a new print stream, without automatic line flushing, with the specified file and charset.

      See Also:
        PrintStream.PrintStream

  - ### Method Detail

    - #### public void print(Object obj)

      Prints an object Groovy style.

      Parameters:
        `obj` - The `Object` to be printed

    - #### public void println(Object obj)

      Prints an object Groovy style followed by a newline.

      Parameters:
        `obj` - The `Object` to be printed