public class InOutCopier
extends java.lang.Thread
InputStream a = getInputStream(); OutputStream b = getOutputStream(); InOutCopier copier = new InOutCopier(a, b); copier.start(); <do stuff that writes to the inputstream>
| Constructor and Description |
|---|
InOutCopier(java.io.InputStream is,
java.io.OutputStream os)
Create a copier from an inputstream to an outputstream
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Force close the stream without waiting for EOF on the source
|
void |
flush()
Flush the outputstream
|
void |
run()
Copies from the inputstream to the outputstream
until EOF on the inputstream or explicitly closed
|
void |
start()
Start the thread and wait to make sure its really started
|
activeCount, checkAccess, clone, 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, stop, stop, suspend, toString, yieldpublic InOutCopier(java.io.InputStream is,
java.io.OutputStream os)
throws java.io.IOException
is - The stream to copy fromos - the stream to copy tojava.io.IOExceptionpublic void close()
public void flush()
throws java.io.IOException
java.io.IOExceptionpublic void start()
start in class java.lang.Threadpublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadclose()