edu.rice.cs.cunit.util
Class StreamRedirectThread

java.lang.Object
  extended by java.lang.Thread
      extended by edu.rice.cs.cunit.util.StreamRedirectThread
All Implemented Interfaces:
java.lang.Runnable

public class StreamRedirectThread
extends java.lang.Thread

StreamRedirectThread is a thread which copies its input to its output and terminates when it completes.

Author:
Mathias Ricken

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private static int BUFFER_SIZE
           
private  java.io.Reader in
           
private  java.io.Writer out
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
StreamRedirectThread(java.lang.String name, java.io.InputStream in, java.io.OutputStream out)
          Constructor
 
Method Summary
 void run()
          Copy.
 
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

in

private final java.io.Reader in

out

private final java.io.Writer out

BUFFER_SIZE

private static final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

StreamRedirectThread

public StreamRedirectThread(java.lang.String name,
                            java.io.InputStream in,
                            java.io.OutputStream out)
Constructor

Parameters:
name - thread name
in - stream to copy from
out - stream to copy to
Method Detail

run

public void run()
Copy.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread