Package groovy.io
Class GroovyPrintStream
- java.lang.Object
- 
- java.io.OutputStream
- 
- java.io.FilterOutputStream
- 
- java.io.PrintStream
- 
- groovy.io.GroovyPrintStream
 
 
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.io.Flushable,- java.lang.Appendable,- java.lang.AutoCloseable
 
 public class GroovyPrintStream extends java.io.PrintStreamA 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 SummaryConstructors Constructor Description GroovyPrintStream(java.io.File file)Creates a new print stream, without automatic line flushing, with the specified file.GroovyPrintStream(java.io.File file, java.lang.String csn)Creates a new print stream, without automatic line flushing, with the specified file and charset.GroovyPrintStream(java.io.OutputStream out)Creates a new print stream.GroovyPrintStream(java.io.OutputStream out, boolean autoFlush)Creates a new print stream.GroovyPrintStream(java.io.OutputStream out, boolean autoFlush, java.lang.String encoding)Creates a new print stream.GroovyPrintStream(java.lang.String fileName)Creates a new print stream, without automatic line flushing, with the specified file name.GroovyPrintStream(java.lang.String fileName, java.lang.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(java.lang.Object obj)Prints an object Groovy style.voidprintln(java.lang.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
 
- 
 
- 
- 
- 
Constructor Detail- 
GroovyPrintStreampublic GroovyPrintStream(java.io.OutputStream out) Creates a new print stream. This stream will not flush automatically.- See Also:
- PrintStream(java.io.OutputStream)
 
 - 
GroovyPrintStreampublic GroovyPrintStream(java.io.OutputStream out, boolean autoFlush)Creates a new print stream.- See Also:
- PrintStream(java.io.OutputStream, boolean)
 
 - 
GroovyPrintStreampublic GroovyPrintStream(java.io.OutputStream out, boolean autoFlush, java.lang.String encoding) throws java.io.UnsupportedEncodingExceptionCreates a new print stream.- Throws:
- java.io.UnsupportedEncodingException
- See Also:
- PrintStream(java.io.OutputStream, boolean, String)
 
 - 
GroovyPrintStreampublic GroovyPrintStream(java.lang.String fileName) throws java.io.FileNotFoundExceptionCreates a new print stream, without automatic line flushing, with the specified file name.- Throws:
- java.io.FileNotFoundException
- See Also:
- PrintStream(String)
 
 - 
GroovyPrintStreampublic GroovyPrintStream(java.lang.String fileName, java.lang.String csn) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingExceptionCreates a new print stream, without automatic line flushing, with the specified file name and charset.- Throws:
- java.io.FileNotFoundException
- java.io.UnsupportedEncodingException
- See Also:
- PrintStream(String, String)
 
 - 
GroovyPrintStreampublic GroovyPrintStream(java.io.File file) throws java.io.FileNotFoundExceptionCreates a new print stream, without automatic line flushing, with the specified file.- Throws:
- java.io.FileNotFoundException
- See Also:
- PrintStream(File)
 
 - 
GroovyPrintStreampublic GroovyPrintStream(java.io.File file, java.lang.String csn) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingExceptionCreates a new print stream, without automatic line flushing, with the specified file and charset.- Throws:
- java.io.FileNotFoundException
- java.io.UnsupportedEncodingException
- See Also:
- PrintStream(File, String)
 
 
- 
 - 
Method Detail- 
printpublic void print(java.lang.Object obj) Prints an object Groovy style.- Overrides:
- printin class- java.io.PrintStream
- Parameters:
- obj- The- Objectto be printed
 
 - 
printlnpublic void println(java.lang.Object obj) Prints an object Groovy style followed by a newline.- Overrides:
- printlnin class- java.io.PrintStream
- Parameters:
- obj- The- Objectto be printed
 
 
- 
 
-