public class PumpStreamHandler extends Object implements ExecuteStreamHandler
Constructor and Description |
---|
PumpStreamHandler() |
PumpStreamHandler(OutputStream outAndErr) |
PumpStreamHandler(OutputStream out,
OutputStream err) |
Modifier and Type | Method and Description |
---|---|
protected void |
createProcessErrorPump(InputStream is,
OutputStream os) |
protected void |
createProcessOutputPump(InputStream is,
OutputStream os) |
protected Thread |
createPump(InputStream is,
OutputStream os)
Creates a stream pumper to copy the given input stream to the given output stream.
|
protected OutputStream |
getErr() |
protected OutputStream |
getOut() |
void |
setProcessErrorStream(InputStream is)
Install a handler for the error stream of the subprocess.
|
void |
setProcessInputStream(OutputStream os)
Install a handler for the input stream of the subprocess.
|
void |
setProcessOutputStream(InputStream is)
Install a handler for the output stream of the subprocess.
|
void |
start()
Start handling of the streams.
|
void |
stop()
Stop handling of the streams - will not be restarted.
|
public PumpStreamHandler(OutputStream out, OutputStream err)
public PumpStreamHandler(OutputStream outAndErr)
public PumpStreamHandler()
public void setProcessOutputStream(InputStream is)
ExecuteStreamHandler
setProcessOutputStream
in interface ExecuteStreamHandler
is
- input stream to read from the error stream from the subprocesspublic void setProcessErrorStream(InputStream is)
ExecuteStreamHandler
setProcessErrorStream
in interface ExecuteStreamHandler
is
- input stream to read from the error stream from the subprocesspublic void setProcessInputStream(OutputStream os)
ExecuteStreamHandler
setProcessInputStream
in interface ExecuteStreamHandler
os
- output stream to write to the standard input stream of the
subprocesspublic void start()
ExecuteStreamHandler
start
in interface ExecuteStreamHandler
public void stop()
ExecuteStreamHandler
stop
in interface ExecuteStreamHandler
protected OutputStream getErr()
protected OutputStream getOut()
protected void createProcessOutputPump(InputStream is, OutputStream os)
protected void createProcessErrorPump(InputStream is, OutputStream os)
protected Thread createPump(InputStream is, OutputStream os)