Package groovy.io
Class GroovyPrintStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
groovy.io.GroovyPrintStream
- All Implemented Interfaces:
- Closeable,- Flushable,- Appendable,- AutoCloseable
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
- 
Field SummaryFields inherited from class java.io.FilterOutputStreamout
- 
Constructor SummaryConstructorsConstructorDescriptionGroovyPrintStream(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.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.
- 
Method SummaryMethods inherited from class java.io.PrintStreamappend, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write, write, write, writeBytesMethods inherited from class java.io.OutputStreamnullOutputStream
- 
Constructor Details- 
GroovyPrintStreamCreates a new print stream. This stream will not flush automatically.- See Also:
 
- 
GroovyPrintStreamCreates a new print stream.
- 
GroovyPrintStreampublic GroovyPrintStream(OutputStream out, boolean autoFlush, String encoding) throws UnsupportedEncodingException Creates a new print stream.
- 
GroovyPrintStreamCreates a new print stream, without automatic line flushing, with the specified file name.- Throws:
- FileNotFoundException
- See Also:
 
- 
GroovyPrintStreampublic GroovyPrintStream(String fileName, String csn) throws FileNotFoundException, UnsupportedEncodingException Creates a new print stream, without automatic line flushing, with the specified file name and charset.- Throws:
- FileNotFoundException
- UnsupportedEncodingException
- See Also:
 
- 
GroovyPrintStreamCreates a new print stream, without automatic line flushing, with the specified file.- Throws:
- FileNotFoundException
- See Also:
 
- 
GroovyPrintStreampublic GroovyPrintStream(File file, String csn) throws FileNotFoundException, UnsupportedEncodingException Creates a new print stream, without automatic line flushing, with the specified file and charset.- Throws:
- FileNotFoundException
- UnsupportedEncodingException
- See Also:
 
 
- 
- 
Method Details- 
printPrints an object Groovy style.- Overrides:
- printin class- PrintStream
- Parameters:
- obj- The- Objectto be printed
 
- 
printlnPrints an object Groovy style followed by a newline.- Overrides:
- printlnin class- PrintStream
- Parameters:
- obj- The- Objectto be printed
 
 
-