public class PumpStreamHandler extends Object implements ExecuteStreamHandler
| Constructor and Description |
|---|
PumpStreamHandler()
Construct a new
PumpStreamHandler. |
PumpStreamHandler(OutputStream outAndErr)
Construct a new
PumpStreamHandler. |
PumpStreamHandler(OutputStream out,
OutputStream err)
Construct a new
PumpStreamHandler. |
PumpStreamHandler(OutputStream out,
OutputStream err,
InputStream input)
Construct a new
PumpStreamHandler. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createProcessErrorPump(InputStream is,
OutputStream os)
Create the pump to handle error output.
|
protected void |
createProcessOutputPump(InputStream is,
OutputStream os)
Create the pump to handle process output.
|
protected Thread |
createPump(InputStream is,
OutputStream os)
Creates a stream pumper to copy the given input stream to the given
output stream.
|
protected Thread |
createPump(InputStream is,
OutputStream os,
boolean closeWhenExhausted)
Creates a stream pumper to copy the given input stream to the given
output stream.
|
OutputStream |
getErr()
Get the error stream.
|
InputStream |
getInput()
Get the input stream.
|
OutputStream |
getOut()
Get the output stream.
|
void |
setProcessErrorStream(InputStream is)
Set the
InputStream from which to read the standard error
of the process. |
void |
setProcessInputStream(OutputStream os)
Set the
OutputStream by means of which input can be sent
to the process. |
void |
setProcessOutputStream(InputStream is)
Set the
InputStream from which to read the standard output
of the process. |
void |
start()
Start the
Threads. |
void |
stop()
Stop pumping the streams.
|
public PumpStreamHandler()
PumpStreamHandler.public PumpStreamHandler(OutputStream outAndErr)
PumpStreamHandler.outAndErr - the output/error OutputStream.public PumpStreamHandler(OutputStream out, OutputStream err)
PumpStreamHandler.out - the output OutputStream.err - the error OutputStream.public PumpStreamHandler(OutputStream out, OutputStream err, InputStream input)
PumpStreamHandler.out - the output OutputStream.err - the error OutputStream.input - the input InputStream.public void setProcessOutputStream(InputStream is)
InputStream from which to read the standard output
of the process.setProcessOutputStream in interface ExecuteStreamHandleris - the InputStream.public void setProcessErrorStream(InputStream is)
InputStream from which to read the standard error
of the process.setProcessErrorStream in interface ExecuteStreamHandleris - the InputStream.public void setProcessInputStream(OutputStream os)
OutputStream by means of which input can be sent
to the process.setProcessInputStream in interface ExecuteStreamHandleros - the OutputStream.public void start()
Threads.start in interface ExecuteStreamHandlerpublic void stop()
stop in interface ExecuteStreamHandlerpublic OutputStream getOut()
OutputStream.public OutputStream getErr()
OutputStream.public InputStream getInput()
InputStream.protected void createProcessOutputPump(InputStream is, OutputStream os)
is - the InputStream.os - the OutputStream.protected void createProcessErrorPump(InputStream is, OutputStream os)
is - the InputStream.os - the OutputStream.protected Thread createPump(InputStream is, OutputStream os)
is - the input stream to copy fromos - the output stream to copy intoprotected Thread createPump(InputStream is, OutputStream os, boolean closeWhenExhausted)
is - the input stream to copy fromos - the output stream to copy intocloseWhenExhausted - close the output stream when the input stream is exhaustedCopyright © 2014 ZeroTurnaround. All rights reserved.