org.gloin.resource.misc
Class StreamPlugThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.gloin.resource.misc.StreamPlugThread
All Implemented Interfaces:
java.lang.Runnable

public class StreamPlugThread
extends java.lang.Thread

StreamPlugThread is a utility class that "plugs" two streams, one input stream and one output stream, together by creating a thread that repeatedly reads any data available from the input stream and writes it to the output stream.


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
StreamPlugThread(java.io.InputStream in, java.io.OutputStream out)
           
 
Method Summary
static void error(java.lang.String err)
           
static void main(java.lang.String[] args)
           
static void plugTogether(java.io.InputStream in, java.io.OutputStream out)
           
static void plugTogether(java.io.OutputStream out, java.io.InputStream in)
           
 void run()
           
static java.lang.Process userProg(java.lang.String cmd)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Constructor Detail

StreamPlugThread

public StreamPlugThread(java.io.InputStream in,
                        java.io.OutputStream out)
Method Detail

run

public void run()
Overrides:
run in class java.lang.Thread

plugTogether

public static void plugTogether(java.io.InputStream in,
                                java.io.OutputStream out)

plugTogether

public static void plugTogether(java.io.OutputStream out,
                                java.io.InputStream in)

userProg

public static java.lang.Process userProg(java.lang.String cmd)
                                  throws java.io.IOException

main

public static void main(java.lang.String[] args)

error

public static void error(java.lang.String err)