Top Description Constructors Methods
groovy.io

public Class GroovyPrintStream

extends PrintStream
Class Inheritance
Imports
org.codehaus.groovy.runtime.InvokerHelper, java.io.File, .FileNotFoundException, .OutputStream, .PrintStream, .UnsupportedEncodingException

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

AccessConstructor and Description
public
GroovyPrintStream(OutputStream out)

Creates a new print stream.

public
GroovyPrintStream(OutputStream out, boolean autoFlush)

Creates a new print stream.

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

Creates a new print stream.

public
GroovyPrintStream(String fileName)

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

public
GroovyPrintStream(String fileName, String csn)

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

public
GroovyPrintStream(File file)

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

public
GroovyPrintStream(File file, String csn)

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

Method Summary

Modifier and TypeMethod and Description
public void
println(Object
The Object to be printed
obj
)

Overrides java.io.PrintStream.println.

Prints an object Groovy style followed by a newline.
Inherited from java.io.PrintStream:
appendappendappendcharsetcheckErrorclearErrorcloseflushformatformatprintprintprintprintprintprintprintprintprintfprintfprintlnprintlnprintlnprintlnprintlnprintlnprintlnprintlnprintlnsetErrorwritewritewritewriteBytes

Constructor Detail

GroovyPrintStreamback to summary
public GroovyPrintStream(OutputStream out)

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

See Also
java.io.PrintStream#PrintStream(java.io.OutputStream)
GroovyPrintStreamback to summary
public GroovyPrintStream(OutputStream out, boolean autoFlush)

Creates a new print stream.

See Also
java.io.PrintStream#PrintStream(java.io.OutputStream, boolean)
GroovyPrintStreamback to summary
public GroovyPrintStream(OutputStream out, boolean autoFlush, String encoding) throws UnsupportedEncodingException

Creates a new print stream.

See Also
java.io.PrintStream#PrintStream(java.io.OutputStream, boolean, String)
GroovyPrintStreamback to summary
public GroovyPrintStream(String fileName) throws FileNotFoundException

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

See Also
java.io.PrintStream#PrintStream(String)
GroovyPrintStreamback to summary
public GroovyPrintStream(String fileName, String csn) throws FileNotFoundException, UnsupportedEncodingException

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

See Also
java.io.PrintStream#PrintStream(String, String)
GroovyPrintStreamback to summary
public GroovyPrintStream(File file) throws FileNotFoundException

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

See Also
java.io.PrintStream#PrintStream(File)
GroovyPrintStreamback to summary
public GroovyPrintStream(File file, String csn) throws FileNotFoundException, UnsupportedEncodingException

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

See Also
java.io.PrintStream#PrintStream(File, String)

Method Detail

printlnback to summary
public void println(Object obj)

Overrides java.io.PrintStream.println.

Prints an object Groovy style followed by a newline.

Parameters
obj:Object

The Object to be printed