public class IO
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
static class |
IO.Verbosity |
Modifier and Type | Field and Description |
---|---|
java.io.PrintWriter |
err
Prefered error output writer.
|
java.io.OutputStream |
errorStream
Raw error output stream.
|
java.io.Reader |
in
Prefered input reader.
|
java.io.InputStream |
inputStream
Raw input stream.
|
java.io.PrintWriter |
out
Prefered output writer.
|
java.io.OutputStream |
outputStream
Raw output stream.
|
Constructor and Description |
---|
IO()
Construct a new IO container using system streams.
|
IO(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
java.io.OutputStream errorStream)
Construct a new IO container.
|
Modifier and Type | Method 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
IO.Verbosity.DEBUG . |
boolean |
isInfo()
Check if the verbosity level is set to
IO.Verbosity.INFO . |
boolean |
isQuiet()
Check if the verbosity level is set to
IO.Verbosity.QUIET . |
boolean |
isVerbose()
Check if the verbosity level is set to
IO.Verbosity.VERBOSE . |
void |
setVerbosity(IO.Verbosity verbosity)
Set the verbosity level.
|
public final java.io.InputStream inputStream
public final java.io.OutputStream outputStream
public final java.io.OutputStream errorStream
public final java.io.Reader in
public final java.io.PrintWriter out
public final java.io.PrintWriter err
public IO(java.io.InputStream inputStream, java.io.OutputStream outputStream, java.io.OutputStream errorStream)
public IO()
public void setVerbosity(IO.Verbosity verbosity)
verbosity
- public IO.Verbosity getVerbosity()
public boolean isQuiet()
IO.Verbosity.QUIET
.public boolean isInfo()
IO.Verbosity.INFO
.public boolean isVerbose()
IO.Verbosity.VERBOSE
.public boolean isDebug()
IO.Verbosity.DEBUG
.
For general usage, when debug output is required, it is better to use the logging facility instead.
public void flush()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException