public class StreamPump
extends Object
implements Runnable
A StreamPump reads lines of text from its given InputStream and informs its LineProcessors until the InputStream is exhausted. It is useful only for pumping lines of text, and not for arbitrary binary cruft. It's handy for reading the output of processes that emit textual data, for example.
Constructor and Description |
---|
StreamPump(InputStream in,
String name) |
Modifier and Type | Method and Description |
---|---|
StreamPump |
addTarget(LineProcessor out) |
StreamPump |
addTarget(OutputStream out) |
StreamPump |
addTarget(Writer out) |
void |
run() |
void |
start() |
public StreamPump addTarget(OutputStream out)
public StreamPump addTarget(Writer out)
public StreamPump addTarget(LineProcessor out)
public void start()
public void run()
run
in interface Runnable