com.glaivestone.javax.io
Class SystemIOStreams

java.lang.Object
  |
  +--com.glaivestone.javax.io.SystemIOStreams

public class SystemIOStreams
extends java.lang.Object

Operations on the standard system I/O streams.

These services provide clients who want to manage the standard system I/O streams during a session with the ability to redefine the system stream such that they can subsequently revert to the original console. This should not be a widely used mechanism - it should generally only be used by fundamental application/session management mechanisms for purposes such as retargeting the system output streams or providing logging services.

Author:
Deb Lewis

Field Summary
static java.io.PrintStream CONSOLE_STDERR
          The original system console error stream.
static java.io.InputStream CONSOLE_STDIN
          The original system console input stream.
static java.io.PrintStream CONSOLE_STDOUT
          The original system console output stream.
 
Method Summary
static void bindConsoleReferences()
          Bind the references to the original system console streams.
static void disconnectSysErr(java.io.PrintStream ps)
          Disconnect the specified target as the system error stream.
static void disconnectSysOut(java.io.PrintStream ps)
          Disconnect the specified target as the system output stream.
static boolean isSysErr(java.io.PrintStream ps)
          Answer whether the specified target is installed in the current system error stream.
static boolean isSysOut(java.io.PrintStream ps)
          Answer whether the specified target is installed in the current system output stream.
static void resetSysErr()
          Reset the standard system error stream System.err to the original system console error stream.
static void resetSysOut()
          Reset the standard system output stream System.out to the original system console output stream
static void resetSystemOutputStreams()
          Reset the standard system output and error streams to the original system console stream.
static void setSysErr(java.io.PrintStream ps)
          Install the given stream as System.err.
static void setSysOut(java.io.PrintStream ps)
          Install the given stream as System.out.
static void setSystemOutputStreams(java.io.PrintStream ps)
          Install the given stream as System.out and System.err.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSOLE_STDIN

public static final java.io.InputStream CONSOLE_STDIN
The original system console input stream.


CONSOLE_STDOUT

public static final java.io.PrintStream CONSOLE_STDOUT
The original system console output stream.


CONSOLE_STDERR

public static final java.io.PrintStream CONSOLE_STDERR
The original system console error stream.

Method Detail

bindConsoleReferences

public static void bindConsoleReferences()
Bind the references to the original system console streams.


disconnectSysErr

public static void disconnectSysErr(java.io.PrintStream ps)
Disconnect the specified target as the system error stream.

Resets the system stream to the original console if this was the sole destination target.


disconnectSysOut

public static void disconnectSysOut(java.io.PrintStream ps)
Disconnect the specified target as the system output stream.

Resets the system stream to the original console if this was the sole destination target.


isSysErr

public static boolean isSysErr(java.io.PrintStream ps)
Answer whether the specified target is installed in the current system error stream.


isSysOut

public static boolean isSysOut(java.io.PrintStream ps)
Answer whether the specified target is installed in the current system output stream.


resetSysErr

public static void resetSysErr()
Reset the standard system error stream System.err to the original system console error stream.


resetSysOut

public static void resetSysOut()
Reset the standard system output stream System.out to the original system console output stream


resetSystemOutputStreams

public static void resetSystemOutputStreams()
Reset the standard system output and error streams to the original system console stream.


setSysErr

public static void setSysErr(java.io.PrintStream ps)
Install the given stream as System.err.


setSysOut

public static void setSysOut(java.io.PrintStream ps)
Install the given stream as System.out.


setSystemOutputStreams

public static void setSystemOutputStreams(java.io.PrintStream ps)
Install the given stream as System.out and System.err.


GFL 1.1 API