public class PumpStreamHandler extends Object
Constructor and Description |
---|
PumpStreamHandler(StreamSet streams) |
Modifier and Type | Method and Description |
---|---|
void |
attach(Process p)
Attach to a child streams from the given process.
|
protected void |
createChildErrorPump(InputStream in,
OutputStream out)
Create the pump to handle error output.
|
protected void |
createChildOutputPump(InputStream in,
OutputStream out)
Create the pump to handle child output.
|
protected StreamPumper |
createInputPump(InputStream in,
OutputStream out,
boolean closeWhenExhausted)
Creates a stream pumper to copy the given input stream to the
given output stream.
|
protected Thread |
createPump(InputStream in,
OutputStream out)
Creates a stream pumper to copy the given input stream to the given output stream.
|
protected Thread |
createPump(InputStream in,
OutputStream out,
boolean closeWhenExhausted)
Creates a stream pumper to copy the given input stream to the
given output stream.
|
void |
setChildErrorStream(InputStream in)
Set the input stream from which to read the standard error of the child.
|
void |
setChildInputStream(OutputStream out)
Set the output stream by means of which input can be sent to the child.
|
void |
setChildOutputStream(InputStream in)
Set the input stream from which to read the standard output of the child.
|
void |
start()
Start pumping the streams.
|
void |
stop()
Stop pumping the streams.
|
public PumpStreamHandler(StreamSet streams)
public void setChildOutputStream(InputStream in)
public void setChildErrorStream(InputStream in)
public void setChildInputStream(OutputStream out)
public void attach(Process p)
p
- The process to attach to.public void start()
public void stop()
protected void createChildOutputPump(InputStream in, OutputStream out)
protected void createChildErrorPump(InputStream in, OutputStream out)
protected Thread createPump(InputStream in, OutputStream out)
protected Thread createPump(InputStream in, OutputStream out, boolean closeWhenExhausted)
in
- The input stream to copy from.out
- The output stream to copy to.closeWhenExhausted
- If true close the inputstream.protected StreamPumper createInputPump(InputStream in, OutputStream out, boolean closeWhenExhausted)
Copyright © 2008-2012 Sonatype. All Rights Reserved.