|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
edu.rice.cs.util.StreamRedirectThread
public class StreamRedirectThread
StreamRedirectThread is a thread which copies its input to its output and terminates when it completes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
StreamRedirectThread(String name,
InputStream in,
OutputStream out)
Constructor |
|
StreamRedirectThread(String name,
InputStream in,
OutputStream out,
boolean close)
Constructor |
|
StreamRedirectThread(String name,
InputStream in,
OutputStream out,
boolean close,
boolean keepRunning)
Constructor |
|
StreamRedirectThread(String name,
InputStream in,
OutputStream out,
boolean close,
ThreadGroup tg)
Constructor |
|
StreamRedirectThread(String name,
InputStream in,
OutputStream out,
boolean close,
ThreadGroup tg,
boolean keepRunning)
Constructor |
|
StreamRedirectThread(String name,
InputStream in,
OutputStream out,
ThreadGroup tg)
Constructor |
|
StreamRedirectThread(String name,
InputStream in,
OutputStream out,
ThreadGroup tg,
boolean keepRunning)
Constructor |
Method Summary | |
---|---|
void |
run()
Copy. |
void |
setInputStream(InputStream in)
Set a new input stream. |
void |
setStopFlag()
Tell the thread to stop copying. |
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 |
Constructor Detail |
---|
public StreamRedirectThread(String name, InputStream in, OutputStream out, boolean close)
name
- thread namein
- stream to copy fromout
- stream to copy toclose
- true if the streams should be closed after copying has endedpublic StreamRedirectThread(String name, InputStream in, OutputStream out, ThreadGroup tg)
name
- thread namein
- stream to copy fromout
- stream to copy totg
- thread group for this threadpublic StreamRedirectThread(String name, InputStream in, OutputStream out, boolean close, ThreadGroup tg)
name
- thread namein
- stream to copy fromout
- stream to copy toclose
- true if the streams should be closed after copying has endedtg
- thread group for this threadpublic StreamRedirectThread(String name, InputStream in, OutputStream out)
name
- thread namein
- stream to copy fromout
- stream to copy topublic StreamRedirectThread(String name, InputStream in, OutputStream out, boolean close, boolean keepRunning)
name
- thread namein
- stream to copy fromout
- stream to copy toclose
- true if the streams should be closed after copying has endedkeepRunning
- true if the thread should keep running and not terminate when a stream endspublic StreamRedirectThread(String name, InputStream in, OutputStream out, ThreadGroup tg, boolean keepRunning)
name
- thread namein
- stream to copy fromout
- stream to copy totg
- thread group for this threadkeepRunning
- true if the thread should keep running and not terminate when a stream endspublic StreamRedirectThread(String name, InputStream in, OutputStream out, boolean close, ThreadGroup tg, boolean keepRunning)
name
- thread namein
- stream to copy fromout
- stream to copy toclose
- true if the streams should be closed after copying has endedtg
- thread group for this threadkeepRunning
- true if the thread should keep running and not terminate when a stream endsMethod Detail |
---|
public void setInputStream(InputStream in)
in
- new input stream to read frompublic void run()
run
in interface Runnable
run
in class Thread
public void setStopFlag()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |