|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.groboclown.util.thread.v1.IOThreadRunner
Loops, reading from the input stream and writes to the output stream.
LoopThread
Field Summary | |
private byte[] |
buffer
|
private static int |
BUFFER_SIZE
|
private boolean |
closeInputOnEOF
|
private boolean |
closeOutputOnEOF
|
private IOException |
exception
|
private InputStream |
is
|
private LoopThread |
lt
|
private Runnable |
ltRunner
|
private OutputStream |
os
|
Constructor Summary | |
IOThreadRunner(InputStream is,
OutputStream os)
Create a new ThreadRunner, re-routing is data into the os stream. |
|
IOThreadRunner(LoopThread lt,
InputStream is,
OutputStream os)
Create a new ThreadRunner, re-routing is data into the os stream, but uses the initialization of the given LoopThread. |
Method Summary | |
IOException |
getException()
Retrieves the most recent exception that occured, if any. |
OutputStream |
getOutputStream()
Retrieves the output stream that the input is redirected to. |
LoopThread |
getThread()
Retrieves the LoopThread instance that manages the operation. |
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. |
void |
setCloseInputOnStop(boolean on)
By setting this to true the runner will close the InputStream once a Stop signal has been encountered. |
void |
setCloseOutputOnStop(boolean on)
By setting this to true the runner will close the OutputStream once a Stop signal has been encountered. |
void |
start()
Starts the stream reading. |
void |
stop()
Stops the thread from reading. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final int BUFFER_SIZE
private InputStream is
private OutputStream os
private byte[] buffer
private LoopThread lt
private IOException exception
private boolean closeInputOnEOF
private boolean closeOutputOnEOF
private Runnable ltRunner
Constructor Detail |
public IOThreadRunner(InputStream is, OutputStream os)
public IOThreadRunner(LoopThread lt, InputStream is, OutputStream os)
Method Detail |
public IOException getException()
public void setCloseInputOnStop(boolean on)
public void setCloseOutputOnStop(boolean on)
public LoopThread getThread()
public OutputStream getOutputStream()
public boolean isReading()
public void start()
public void stop() throws IOException
protected void registerException(IOException ioe)
protected void reachedEOF()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |