de.infinityloop.util.inout
Class StreamMunger

java.lang.Object
  extended by java.lang.Thread
      extended by de.infinityloop.util.inout.StreamMunger
All Implemented Interfaces:
java.lang.Runnable

public class StreamMunger
extends java.lang.Thread

This class munges a given stream (empties it). Options can be set to redirect the contents to some other destination.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int kDiscard
           
static int kLogDebug
           
static int kLogError
           
static int kLogInfo
           
static int kLogMessage
           
static int kLogWarn
           
static int kStringBuffer
           
static int kSysErr
           
static int kSysOut
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
StreamMunger(java.io.InputStream is, java.lang.StringBuffer dest)
          Reads the stream and writes the contents into dest
StreamMunger(java.io.InputStream is, java.lang.String type, int action)
           
 
Method Summary
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kDiscard

public static final int kDiscard
See Also:
Constant Field Values

kSysOut

public static final int kSysOut
See Also:
Constant Field Values

kSysErr

public static final int kSysErr
See Also:
Constant Field Values

kLogInfo

public static final int kLogInfo
See Also:
Constant Field Values

kLogDebug

public static final int kLogDebug
See Also:
Constant Field Values

kLogError

public static final int kLogError
See Also:
Constant Field Values

kLogWarn

public static final int kLogWarn
See Also:
Constant Field Values

kLogMessage

public static final int kLogMessage
See Also:
Constant Field Values

kStringBuffer

public static final int kStringBuffer
See Also:
Constant Field Values
Constructor Detail

StreamMunger

public StreamMunger(java.io.InputStream is,
                    java.lang.String type,
                    int action)

StreamMunger

public StreamMunger(java.io.InputStream is,
                    java.lang.StringBuffer dest)
Reads the stream and writes the contents into dest

Parameters:
is - the input stream to read
dest - the destination StringBuffer
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread