Package: org.codehaus.groovy.tools.shell

## [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

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `static class` | `IO.Verbosity` | Verbosity for simple logging: QUIET, INFO, VERBOSE, DEBUG

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `boolean` | `ansiSupported` | Whether ansi support is available
    `PrintWriter` | `err` | Preferred error output writer.
    `OutputStream` | `errorStream` | Raw error output stream.
    `Reader` | `in` | Preferred input reader.
    `InputStream` | `inputStream` | Raw input stream.
    `PrintWriter` | `out` | Preferred output writer.
    `OutputStream` | `outputStream` | Raw output stream.

  - ### Constructor Summary

    Constructors
    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

    Methods
    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.
    `` | `protected PrintWriter` | `tryConstructRenderWriter(OutputStream stream)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### public final boolean ansiSupported

      Whether ansi support is available

    - #### public final PrintWriter err

      Preferred error output writer.

    - #### public final OutputStream errorStream

      Raw error output stream.

    - #### public final Reader in

      Preferred input reader.

    - #### public final InputStream inputStream

      Raw input stream.

    - #### public final PrintWriter out

      Preferred 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.

    - #### protected PrintWriter tryConstructRenderWriter(OutputStream stream)