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.
  • Field Details

    • 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
      Preferred input reader.
    • out

      public final PrintWriter out
      Preferred output writer.
    • err

      public final PrintWriter err
      Preferred error output writer.
    • ansiSupported

      public final boolean ansiSupported
      Whether ansi support is available
  • Constructor Details

    • 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 Details

    • tryConstructRenderWriter

      protected PrintWriter tryConstructRenderWriter(OutputStream stream)
    • setVerbosity

      public void setVerbosity(IO.Verbosity verbosity)
      Set the verbosity level.
    • 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 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 IOException
      Close all streams.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException