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 Summary
Nested Classes Modifier and Type Class Description static classIO.Verbosity 
- 
Field Summary
Fields Modifier and Type Field Description PrintWritererrPrefered error output writer.OutputStreamerrorStreamRaw error output stream.ReaderinPrefered input reader.InputStreaminputStreamRaw input stream.PrintWriteroutPrefered output writer.OutputStreamoutputStreamRaw output stream. 
- 
Constructor Summary
Constructors Constructor Description IO()Construct a new IO container using system streams.IO(InputStream inputStream, OutputStream outputStream, OutputStream errorStream)Construct a new IO container. 
- 
Method Summary
All 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. 
 - 
 
- 
- 
Field Detail
- 
inputStream
public final InputStream inputStream
Raw input stream. 
- 
outputStream
public final OutputStream outputStream
Raw output stream. 
- 
errorStream
public final OutputStream errorStream
Raw error output stream. 
- 
in
public final Reader in
Prefered input reader. 
- 
out
public final PrintWriter out
Prefered output writer. 
- 
err
public final PrintWriter err
Prefered error output writer. 
 - 
 
- 
Constructor Detail
- 
IO
public IO(InputStream inputStream, OutputStream outputStream, OutputStream errorStream)
Construct a new IO container. 
- 
IO
public IO()
Construct a new IO container using system streams. 
 - 
 
- 
Method Detail
- 
setVerbosity
public void setVerbosity(IO.Verbosity verbosity)
Set the verbosity level.- Parameters:
 verbosity-
 
- 
getVerbosity
public IO.Verbosity getVerbosity()
Returns the verbosity level. 
- 
isQuiet
public boolean isQuiet()
Check if the verbosity level is set toIO.Verbosity.QUIET. 
- 
isInfo
public boolean isInfo()
Check if the verbosity level is set toIO.Verbosity.INFO. 
- 
isVerbose
public boolean isVerbose()
Check if the verbosity level is set toIO.Verbosity.VERBOSE. 
- 
isDebug
public 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.
 
- 
flush
public void flush()
Flush both output streams. 
- 
close
public void close() throws IOExceptionClose all streams.- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Throws:
 IOException
 
 - 
 
 -