public class OutputCollector
extends java.lang.Object
implements java.lang.Runnable
| Constructor and Description |
|---|
OutputCollector(java.io.InputStream in)
Constructor.
|
OutputCollector(java.io.InputStream in,
boolean collect)
Constructor.
|
OutputCollector(java.io.InputStream in,
java.lang.StringBuffer sb)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.StringBuffer |
getOutput()
Returns the output collected from the stream.
|
protected void |
handleLineRead(java.lang.String line)
Called every time a line is read from the stream.
|
void |
run() |
public OutputCollector(java.io.InputStream in)
in - The input stream.public OutputCollector(java.io.InputStream in,
java.lang.StringBuffer sb)
in - The input stream.sb - The buffer in which to collect the output.public OutputCollector(java.io.InputStream in,
boolean collect)
in - The input stream.collect - Whether to actually collect the output in a buffer.
If this is false, then getOutput() will
return null. This parameter can be used if you want
to eat, but ignore, stdout or stderr for a process.public java.lang.StringBuffer getOutput()
protected void handleLineRead(java.lang.String line)
line - The line read.public void run()
run in interface java.lang.Runnable