|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
cx.ath.matthew.io.InOutCopier
public class InOutCopier
Copies from an input stream to an output stream using a Thread. example:
InputStream a = getInputStream(); OutputStream b = getOutputStream(); InOutCopier copier = new InOutCopier(a, b); copier.start(); <do stuff that writes to the inputstream>
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
InOutCopier(java.io.InputStream is,
java.io.OutputStream os)
Create a copier from an inputstream to an outputstream |
Method Summary | |
---|---|
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 |
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, 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 InOutCopier(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
is
- The stream to copy fromos
- the stream to copy to
java.io.IOException
Method Detail |
---|
public void close()
public void flush() throws java.io.IOException
java.io.IOException
public void start()
start
in class java.lang.Thread
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |