| java.lang.Object java.lang.Thread org.mmbase.util.externalprocess.StreamCopyThread
StreamCopyThread | class StreamCopyThread extends Thread (Code) | | Thread which continuously reads from a input stream and pushes the read data
to an output stream which is immediately flushed afterwards.
author: Nico Klasens (Finalist IT Group) version: $Id: StreamCopyThread.java,v 1.4 2005/01/30 16:46:39 nico Exp $ since: MMBase-1.6 |
Field Summary | |
final public static int | BUFFER_SIZE Default buffer size. | final protected static long | WAIT_DELAY |
Method Summary | |
protected synchronized void | complete() | public synchronized boolean | finished() | public void | run() | public synchronized void | waitFor() |
BUFFER_SIZE | final public static int BUFFER_SIZE(Code) | | Default buffer size.
|
WAIT_DELAY | final protected static long WAIT_DELAY(Code) | | The number of milliseconds to wait before writing
|
StreamCopyThread | public StreamCopyThread(String name, InputStream in, OutputStream out, boolean pInput)(Code) | | Create a thread to copy bytes fro one strea to the other
Parameters: name - the name of the new thread Parameters: in - the stream from which to pipe the data Parameters: out - the stream to pipe the data to Parameters: pInput - This thread writes to the external process |
StreamCopyThread | public StreamCopyThread(ThreadGroup group, String name, InputStream in, OutputStream out, boolean pInput)(Code) | | Create a thread to copy bytes fro one stream to the other
Parameters: group - ThreadGroup where this thread belongs to Parameters: name - the name of the new thread Parameters: in - the stream from which to pipe the data Parameters: out - the stream to pipe the data to Parameters: bSize - the size of the buffer in which data is piped Parameters: pInput - This thread writes to the external process |
complete | protected synchronized void complete()(Code) | | This method is called when the copying of bytes is done and notifies a
waiting thread
|
finished | public synchronized boolean finished()(Code) | | Returns whether this thread has finished copying bytes
true if finished and false otherwise |
waitFor | public synchronized void waitFor()(Code) | | By calling this method the calling thread will wait until this thread is
finished copying bytes
|
|
|