public class PipeReader extends Object implements Runnable
PipedInputStream and PipedOutputStream. Use readInThreads(InputStream, OutputStream) to let
it do the whole work.
Their are two use cases: getPrintStream() - creating one new thread. You should connect the print-stream to the desired instance
(like System.out).| Constructor and Description |
|---|
PipeReader(InputStream in,
OutputStream out)
constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected PipedOutputStream |
getConnectionPipe() |
PrintStream |
getPrintStream()
getPrintStream
|
static PrintStream |
readInThreads(InputStream in,
OutputStream out)
creates a PipeReader starting one (if in is null) or two threads to connect the streams through a pipe.
|
void |
run() |
public PipeReader(InputStream in, OutputStream out)
in - (optional) input stream (not yet an PipedInputStream!) to be connected to the output stream. if
null, only a pipe from to the output-stream will be set.po - output stream (not yet an PipedOutputStream!) to be connected to the input stream.public PrintStream getPrintStream()
protected PipedOutputStream getConnectionPipe()
public static PrintStream readInThreads(InputStream in, OutputStream out)
in - (optional) input stream (not yet an PipedInputStream!) to be connected to the output stream. if
null, only a pipe from to the output-stream will be set.po - output stream (not yet an PipedOutputStream!) to be connected to the input stream.Copyright © 2012–2018. All rights reserved.