- All Implemented Interfaces:
public class StreamCopyThread
- extends Thread
Thread to copy from an input stream to an output stream.
Request the thread to flush the output stream as soon as possible.
Request that the thread terminate, and wait for it.
|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
public StreamCopyThread(InputStream i,
- Create a thread to copy data from an input stream to an output stream.
i - stream to copy from. The thread terminates when this stream
reaches EOF. The thread closes this stream before it exits.
o - stream to copy into. The destination stream is automatically
closed when the thread terminates.
public void flush()
- Request the thread to flush the output stream as soon as possible.
This is an asynchronous request to the thread. The actual flush will
happen at some future point in time, when the thread wakes up to process
public void halt()
- Request that the thread terminate, and wait for it.
This method signals to the copy thread that it should stop as soon as
there is no more IO occurring.
InterruptedException - the calling thread was interrupted.
public void run()
- Specified by:
run in interface
run in class
Copyright © 2013. All Rights Reserved.