|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.Streams.PipeHandler
public static class Streams.PipeHandler
Controller for handling all three streams for a child process asynchronously. Each of stdin, stdout, and stderr can be connected to any suitable stream; the child process's corresponding streams will be connected automatically in a multithreaded, asynchronous manner.
| Field Summary | |
|---|---|
BufferedInputStream |
childErr
The child's standard error stream, which, to the parent, is an input stream. |
BufferedOutputStream |
childIn
The child's standard input stream, which, to the parent, is an output stream. |
BufferedInputStream |
childOut
The child's standard output stream, which, to the parent, is an input stream. |
BufferedOutputStream |
parentErr
An output stream supplied by the parent, to be connected to the child's standard error. |
BufferedInputStream |
parentIn
An input stream supplied by the parent, to be connected to the child's standard input. |
BufferedOutputStream |
parentOut
An output stream supplied by the parent, to be connected to the child's standard output. |
| Constructor Summary | |
|---|---|
Streams.PipeHandler(InputStream parentIn,
OutputStream childIn,
OutputStream parentOut,
InputStream childOut,
OutputStream parentErr,
InputStream childErr)
Construct a pipe handler. |
|
| Method Summary | |
|---|---|
void |
finish()
Stop forwarding data, flushing all output. |
void |
handle()
Run the pipe handler, forwarding data along the given connections. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final BufferedInputStream childOut
public final BufferedInputStream childErr
public final BufferedInputStream parentIn
public final BufferedOutputStream childIn
public final BufferedOutputStream parentOut
public final BufferedOutputStream parentErr
| Constructor Detail |
|---|
public Streams.PipeHandler(InputStream parentIn,
OutputStream childIn,
OutputStream parentOut,
InputStream childOut,
OutputStream parentErr,
InputStream childErr)
parentIn - The stream to use for input.childIn - The child's standard input stream.parentOut - The stream to use for output.childOut - The child's standard output stream.parentErr - The stream to use for stderr.childErr - The child's standard error stream.| Method Detail |
|---|
public void handle()
throws IOException
IOException - If anything goes wrong with any of the streams.
public void finish()
throws IOException
IOException - If anything goes wrong.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||