Package: groovy.io

## [Java] Class GroovyPrintStream

- groovy.io.GroovyPrintStream

- 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).

  Authors:
    Jim White
  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
    --- | --- | ---
    `` | `void` | `print(Object obj)` Prints an object Groovy style.
    `` | `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`

    `println, println, println, println, println, println, println, println, println, println, append, append, append, append, append, append, flush, format, format, charset, printf, printf, write, write, write, print, print, print, print, print, print, print, print, print, close, writeBytes, checkError, nullOutputStream, equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

    `class FilterOutputStream` | `flush, write, write, write, close, nullOutputStream, equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### 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