org.sonatype.gshell.io
Class StreamSet

java.lang.Object
  extended by org.sonatype.gshell.io.StreamSet

public class StreamSet
extends java.lang.Object

A set of input, output and error streams.

Since:
2.0
Author:
Jason Dillon

Nested Class Summary
static class StreamSet.OutputType
          Output stream type.
 
Field Summary
 java.io.PrintStream err
           
 java.io.InputStream in
           
 java.io.PrintStream out
           
static StreamSet SYSTEM
          The original System streams (as they were when this class loads).
static StreamSet SYSTEM_FD
          The System streams as file streams, for a better chance of non-buffered I/O.
 
Constructor Summary
StreamSet(java.io.InputStream in, java.io.PrintStream out)
           
StreamSet(java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
           
 
Method Summary
 void close()
           
 void flush()
           
 java.io.InputStream getInput()
           
 java.io.PrintStream getOutput(StreamSet.OutputType type)
           
 boolean isOutputCombined()
           
static StreamSet system()
          Create a new stream set as System is currently configured.
static void system(StreamSet streams)
          Install the given stream set as the System streams.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

in

public final java.io.InputStream in

out

public final java.io.PrintStream out

err

public final java.io.PrintStream err

SYSTEM

public static final StreamSet SYSTEM
The original System streams (as they were when this class loads).


SYSTEM_FD

public static final StreamSet SYSTEM_FD
The System streams as file streams, for a better chance of non-buffered I/O.

Constructor Detail

StreamSet

public StreamSet(java.io.InputStream in,
                 java.io.PrintStream out,
                 java.io.PrintStream err)

StreamSet

public StreamSet(java.io.InputStream in,
                 java.io.PrintStream out)
Method Detail

isOutputCombined

public boolean isOutputCombined()

getInput

public java.io.InputStream getInput()

getOutput

public java.io.PrintStream getOutput(StreamSet.OutputType type)

flush

public void flush()

close

public void close()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

system

public static StreamSet system()
Create a new stream set as System is currently configured.


system

public static void system(StreamSet streams)
Install the given stream set as the System streams.



Copyright © 2008-2009. All Rights Reserved.