Package org.codehaus.groovy.tools.shell
Class IO
java.lang.Object
org.codehaus.groovy.tools.shell.IO
- All Implemented Interfaces:
- Closeable,- AutoCloseable
Container for input/output handles.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classVerbosity for simple logging: QUIET, INFO, VERBOSE, DEBUG
- 
Field SummaryFieldsModifier and TypeFieldDescriptionfinal booleanWhether ansi support is availablefinal PrintWriterPreferred error output writer.final OutputStreamRaw error output stream.final ReaderPreferred input reader.final InputStreamRaw input stream.final PrintWriterPreferred output writer.final OutputStreamRaw output stream.
- 
Constructor SummaryConstructorsConstructorDescriptionIO()Construct a new IO container using system streams.IO(InputStream inputStream, OutputStream outputStream, OutputStream errorStream) Construct a new IO container.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close all streams.voidflush()Flush both output streams.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.booleanCheck if the verbosity level is set toIO.Verbosity.VERBOSE.voidsetVerbosity(IO.Verbosity verbosity) Set the verbosity level.protected PrintWritertryConstructRenderWriter(OutputStream stream) 
- 
Field Details- 
inputStreamRaw input stream.
- 
outputStreamRaw output stream.
- 
errorStreamRaw error output stream.
- 
inPreferred input reader.
- 
outPreferred output writer.
- 
errPreferred error output writer.
- 
ansiSupportedpublic final boolean ansiSupportedWhether ansi support is available
 
- 
- 
Constructor Details- 
IOConstruct a new IO container.
- 
IOpublic IO()Construct a new IO container using system streams.
 
- 
- 
Method Details- 
tryConstructRenderWriter
- 
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.
- 
closeClose all streams.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 
-