| |
|
| java.lang.Object java.lang.Thread org.griphyn.cPlanner.common.StreamGobbler
StreamGobbler | public class StreamGobbler extends Thread (Code) | | A Stream gobbler class to take care of reading from a stream and optionally
write out to another stream. Allows for non blocking reads on both stdout
and stderr, when invoking a process through Runtime.exec().
Also, the user can specify a callback that is called whenever anything
is read from the stream.
author: Karan Vahi |
Method Summary | |
public void | close() Closes the underneath input and output stream that were opened. | protected void | finalize() Closes the open connections to the streams whenever this object
is destroyed. | public void | redirect(OutputStream ops, String prompt) Sets the output stream to which to redirect the contents of the input
stream. | public void | run() The main method of the gobbler, that does all the work. |
StreamGobbler | public StreamGobbler(InputStream is, StreamGobblerCallback callback)(Code) | | The overloaded constructor.
Parameters: is - the input stream from which to read from. Parameters: callback - the callback to call when a line is read. |
close | public void close()(Code) | | Closes the underneath input and output stream that were opened.
|
finalize | protected void finalize()(Code) | | Closes the open connections to the streams whenever this object
is destroyed.
|
redirect | public void redirect(OutputStream ops, String prompt)(Code) | | Sets the output stream to which to redirect the contents of the input
stream.
Parameters: ops - the output stream. Parameters: prompt - the prompt for the output stream. |
run | public void run()(Code) | | The main method of the gobbler, that does all the work.
|
|
|
|