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
 
 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
 
- 
- 
Field Summary- 
Fields inherited from class java.io.FilterOutputStreamout
 
- 
 - 
Constructor SummaryConstructors Constructor Description 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.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.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprint(Object obj)Prints an object Groovy style.voidprintln(Object obj)Prints an object Groovy style followed by a newline.- 
Methods 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
 - 
Methods inherited from class java.io.FilterOutputStreamwrite
 - 
Methods inherited from class java.io.OutputStreamnullOutputStream
 
- 
 
- 
- 
- 
Constructor Detail- 
GroovyPrintStreampublic GroovyPrintStream(OutputStream out) Creates a new print stream. This stream will not flush automatically.- See Also:
- PrintStream(java.io.OutputStream)
 
 - 
GroovyPrintStreampublic GroovyPrintStream(OutputStream out, boolean autoFlush) Creates a new print stream.
 - 
GroovyPrintStreampublic GroovyPrintStream(OutputStream out, boolean autoFlush, String encoding) throws UnsupportedEncodingException Creates a new print stream.
 - 
GroovyPrintStreampublic GroovyPrintStream(String fileName) throws FileNotFoundException Creates a new print stream, without automatic line flushing, with the specified file name.- Throws:
- FileNotFoundException
- See Also:
- PrintStream(String)
 
 - 
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:
- PrintStream(String, String)
 
 - 
GroovyPrintStreampublic GroovyPrintStream(File file) throws FileNotFoundException Creates a new print stream, without automatic line flushing, with the specified file.- Throws:
- FileNotFoundException
- See Also:
- PrintStream(File)
 
 - 
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:
- PrintStream(File, String)
 
 
- 
 - 
Method Detail- 
printpublic void print(Object obj) Prints an object Groovy style.- Overrides:
- printin class- PrintStream
- Parameters:
- obj- The- Objectto be printed
 
 - 
printlnpublic void println(Object obj) Prints an object Groovy style followed by a newline.- Overrides:
- printlnin class- PrintStream
- Parameters:
- obj- The- Objectto be printed
 
 
- 
 
-