Package org.codehaus.groovy.tools.shell
Class IO
java.lang.Object
org.codehaus.groovy.tools.shell.IO
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable
public class IO
extends java.lang.Object
implements java.io.Closeable
Container for input/output handles.
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classIO.VerbosityVerbosity for simple logging: QUIET, INFO, VERBOSE, DEBUG
- 
Field SummaryFields Modifier and Type Field Description booleanansiSupportedWhether ansi support is availablejava.io.PrintWritererrPreferred error output writer.java.io.OutputStreamerrorStreamRaw error output stream.java.io.ReaderinPreferred input reader.java.io.InputStreaminputStreamRaw input stream.java.io.PrintWriteroutPreferred output writer.java.io.OutputStreamoutputStreamRaw output stream.
- 
Constructor Summary
- 
Method SummaryModifier and Type Method Description voidclose()Close all streams.voidflush()Flush both output streams.IO.VerbositygetVerbosity()Returns the verbosity level.booleanisDebug()Check if the verbosity level is set toIO.Verbosity.DEBUG.booleanisInfo()Check if the verbosity level is set toIO.Verbosity.INFO.booleanisQuiet()Check if the verbosity level is set toIO.Verbosity.QUIET.booleanisVerbose()Check if the verbosity level is set toIO.Verbosity.VERBOSE.voidsetVerbosity(IO.Verbosity verbosity)Set the verbosity level.protected java.io.PrintWritertryConstructRenderWriter(java.io.OutputStream stream)Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Field Details- 
inputStreampublic final java.io.InputStream inputStreamRaw input stream.
- 
outputStreampublic final java.io.OutputStream outputStreamRaw output stream.
- 
errorStreampublic final java.io.OutputStream errorStreamRaw error output stream.
- 
inpublic final java.io.Reader inPreferred input reader.
- 
outpublic final java.io.PrintWriter outPreferred output writer.
- 
errpublic final java.io.PrintWriter errPreferred error output writer.
- 
ansiSupportedpublic final boolean ansiSupportedWhether ansi support is available
 
- 
- 
Constructor Details- 
IOpublic IO(java.io.InputStream inputStream, java.io.OutputStream outputStream, java.io.OutputStream errorStream)Construct a new IO container.
- 
IOpublic IO()Construct a new IO container using system streams.
 
- 
- 
Method Details- 
tryConstructRenderWriterprotected java.io.PrintWriter tryConstructRenderWriter(java.io.OutputStream stream)
- 
setVerbositySet the verbosity level.
- 
getVerbosityReturns the verbosity level.
- 
isQuietpublic boolean isQuiet()Check if the verbosity level is set toIO.Verbosity.QUIET.
- 
isInfopublic boolean isInfo()Check if the verbosity level is set toIO.Verbosity.INFO.
- 
isVerbosepublic boolean isVerbose()Check if the verbosity level is set toIO.Verbosity.VERBOSE.
- 
isDebugpublic boolean isDebug()Check if the verbosity level is set toIO.Verbosity.DEBUG.For general usage, when debug output is required, it is better to use the logging facility instead. 
- 
flushpublic void flush()Flush both output streams.
- 
closepublic void close() throws java.io.IOExceptionClose all streams.- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Throws:
- java.io.IOException
 
 
-