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 Summary
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorDescriptionGroovyPrintStream
(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 Summary
Methods inherited from class java.io.PrintStream
append, 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, writeBytes
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
GroovyPrintStream
Creates a new print stream. This stream will not flush automatically.- See Also:
-
GroovyPrintStream
Creates a new print stream. -
GroovyPrintStream
public GroovyPrintStream(OutputStream out, boolean autoFlush, String encoding) throws UnsupportedEncodingException Creates a new print stream. -
GroovyPrintStream
Creates a new print stream, without automatic line flushing, with the specified file name.- Throws:
FileNotFoundException
- See Also:
-
GroovyPrintStream
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.- Throws:
FileNotFoundException
UnsupportedEncodingException
- See Also:
-
GroovyPrintStream
Creates a new print stream, without automatic line flushing, with the specified file.- Throws:
FileNotFoundException
- See Also:
-
GroovyPrintStream
public 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
-
print
Prints an object Groovy style.- Overrides:
print
in classPrintStream
- Parameters:
obj
- TheObject
to be printed
-
println
Prints an object Groovy style followed by a newline.- Overrides:
println
in classPrintStream
- Parameters:
obj
- TheObject
to be printed
-