[Java] Class IO
- org.codehaus.groovy.tools.shell.IO
- All Implemented Interfaces and Traits:
- Closeable
public class IO extends Object
Container for input/output handles.
- Authors:
- Jason Dillon
Nested Class Summary
Modifiers | Name | Description |
---|---|---|
static class | IO.Verbosity |
Field Summary
Modifiers | Name | Description |
---|---|---|
PrintWriter | err | Prefered error output writer. |
OutputStream | errorStream | Raw error output stream. |
Reader | in | Prefered input reader. |
InputStream | inputStream | Raw input stream. |
PrintWriter | out | Prefered output writer. |
OutputStream | outputStream | Raw output stream. |
Constructor Summary
Constructor and description |
---|
IO
(InputStream inputStream, OutputStream outputStream, OutputStream errorStream) Construct a new IO container. |
IO
() Construct a new IO container using system streams. |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
void |
close() Close all streams. | |
void |
flush() Flush both output streams. | |
IO.Verbosity |
getVerbosity() Returns the verbosity level. | |
boolean |
isDebug() Check if the verbosity level is set to Verbosity#DEBUG#DEBUG. | |
boolean |
isInfo() Check if the verbosity level is set to Verbosity#INFO#INFO. | |
boolean |
isQuiet() Check if the verbosity level is set to Verbosity#QUIET#QUIET. | |
boolean |
isVerbose() Check if the verbosity level is set to Verbosity#VERBOSE#VERBOSE. | |
void |
setVerbosity(IO.Verbosity verbosity) Set the verbosity level. |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail
public final PrintWriter err
Prefered error output writer.
public final OutputStream errorStream
Raw error output stream.
public final Reader in
Prefered input reader.
public final InputStream inputStream
Raw input stream.
public final PrintWriter out
Prefered output writer.
public final OutputStream outputStream
Raw output stream.
Constructor Detail
public IO(InputStream inputStream, OutputStream outputStream, OutputStream errorStream)
Construct a new IO container.
public IO()
Construct a new IO container using system streams.
Method Detail
public void close()
Close all streams.
public void flush()
Flush both output streams.
public IO.Verbosity getVerbosity()
Returns the verbosity level.
public boolean isDebug()
Check if the verbosity level is set to Verbosity#DEBUG#DEBUG.
For general usage, when debug output is required, it is better to use the logging facility instead.
public boolean isInfo()
Check if the verbosity level is set to Verbosity#INFO#INFO.
public boolean isQuiet()
Check if the verbosity level is set to Verbosity#QUIET#QUIET.
public boolean isVerbose()
Check if the verbosity level is set to Verbosity#VERBOSE#VERBOSE.
public void setVerbosity(IO.Verbosity verbosity)
Set the verbosity level.
- Parameters:
- verbosity
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.4.21/html/gapi/org/codehaus/groovy/tools/shell/IO.html