## org.codehaus.groovy.tools.shell
Class IO

    java.lang.Object
      org.codehaus.groovy.tools.shell.IO

    public class IO

extends Object

Container for input/output handles.

Version:
  $Id: IO.java 8907 2007-10-30 12:28:43Z paulk $
Author:
  Jason Dillon

Nested Class Summary
`static class` `IO.Verbosity`

Field Summary
`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
`IO()` Construct a new IO container using system streams.
`IO(InputStream inputStream, OutputStream outputStream, OutputStream errorStream)` Construct a new IO container.

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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 to `IO.Verbosity.QUIET`.

### isInfo

    public boolean isInfo()

  Check if the verbosity level is set to `IO.Verbosity.INFO`.

### isVerbose

    public boolean isVerbose()

  Check if the verbosity level is set to `IO.Verbosity.VERBOSE`.

### isDebug

    public boolean isDebug()

  Check if the verbosity level is set to `IO.Verbosity.DEBUG`.

  For generaly usage, when debug output is required, it is better to use the logging facility instead.

### flush

    public void flush()
               throws IOException

  Flush both output streams.

  Throws:
    `IOException`

### close

    public void close()
               throws IOException

  Close all streams.

  Throws:
    `IOException`

Copyright © 2003-2009 The Codehaus. All rights reserved.