Package org.codehaus.groovy.tools.shell
Class IO
- java.lang.Object
- 
- org.codehaus.groovy.tools.shell.IO
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable
 
 public class IO extends Object implements 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 availablePrintWritererrPreferred error output writer.OutputStreamerrorStreamRaw error output stream.ReaderinPreferred input reader.InputStreaminputStreamRaw input stream.PrintWriteroutPreferred output writer.OutputStreamoutputStreamRaw output stream.
 - 
Constructor SummaryConstructors Constructor Description IO()Construct a new IO container using system streams.IO(InputStream inputStream, OutputStream outputStream, OutputStream errorStream)Construct a new IO container.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier 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 PrintWritertryConstructRenderWriter(OutputStream stream)
 
- 
- 
- 
Field Detail- 
inputStreampublic final InputStream inputStream Raw input stream.
 - 
outputStreampublic final OutputStream outputStream Raw output stream.
 - 
errorStreampublic final OutputStream errorStream Raw error output stream.
 - 
inpublic final Reader in Preferred input reader.
 - 
outpublic final PrintWriter out Preferred output writer.
 - 
errpublic final PrintWriter err Preferred error output writer.
 - 
ansiSupportedpublic final boolean ansiSupported Whether ansi support is available
 
- 
 - 
Constructor Detail- 
IOpublic IO(InputStream inputStream, OutputStream outputStream, OutputStream errorStream) Construct a new IO container.
 - 
IOpublic IO() Construct a new IO container using system streams.
 
- 
 - 
Method Detail- 
tryConstructRenderWriterprotected PrintWriter tryConstructRenderWriter(OutputStream stream) 
 - 
setVerbositypublic void setVerbosity(IO.Verbosity verbosity) Set the verbosity level.
 - 
getVerbositypublic IO.Verbosity getVerbosity() Returns 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 IOExceptionClose all streams.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 
- 
 
-