| java.lang.Object net.sourceforge.groboutils.util.thread.v1.IOThreadRunner
IOThreadRunner | public class IOThreadRunner (Code) | | Loops, reading from the input stream and writes to the output stream.
author: Matt Albrecht groboclown@users.sourceforge.net since: November 17, 2000 version: $Date: 2003/02/10 22:52:48 $ See Also: LoopThread |
Method Summary | |
public IOException | getException() Retrieves the most recent exception that occured, if any. | public OutputStream | getOutputStream() Retrieves the output stream that the input is redirected to. | public LoopThread | getThread() Retrieves the LoopThread instance that manages the operation. | public boolean | isReading() | protected void | reachedEOF() Stop the reading and void out any exceptions. | protected void | registerException(IOException ioe) Post an exception, and stop the reading. | public void | setCloseInputOnStop(boolean on) By setting this to true the runner will close the InputStream
once a Stop signal has been encountered. | public void | setCloseOutputOnStop(boolean on) By setting this to true the runner will close the OutputStream
once a Stop signal has been encountered. | public void | start() Starts the stream reading. | public void | stop() Stops the thread from reading. |
IOThreadRunner | public IOThreadRunner(LoopThread lt, InputStream is, OutputStream os)(Code) | | Create a new ThreadRunner, re-routing is data into the
os stream, but uses the initialization of the given
LoopThread. Note that lt must not be a running thread.
|
getException | public IOException getException()(Code) | | Retrieves the most recent exception that occured, if any. If no
exception happened, then it returns null.
|
getOutputStream | public OutputStream getOutputStream()(Code) | | Retrieves the output stream that the input is redirected to.
|
getThread | public LoopThread getThread()(Code) | | Retrieves the LoopThread instance that manages the operation. You
can use this instance for setting up the thread (such as setting
priority and daemon status).
|
isReading | public boolean isReading()(Code) | | true if the thread is alive and reading thestream, or false if it is not reading. |
reachedEOF | protected void reachedEOF()(Code) | | Stop the reading and void out any exceptions.
|
registerException | protected void registerException(IOException ioe)(Code) | | Post an exception, and stop the reading.
|
setCloseInputOnStop | public void setCloseInputOnStop(boolean on)(Code) | | By setting this to true the runner will close the InputStream
once a Stop signal has been encountered.
|
setCloseOutputOnStop | public void setCloseOutputOnStop(boolean on)(Code) | | By setting this to true the runner will close the OutputStream
once a Stop signal has been encountered.
|
start | public void start()(Code) | | Starts the stream reading.
|
|
|