java.io
public class: PipedOutputStream [javadoc |
source]
java.lang.Object
java.io.OutputStream
java.io.PipedOutputStream
All Implemented Interfaces:
Flushable, Closeable
A piped output stream can be connected to a piped input stream
to create a communications pipe. The piped output stream is the
sending end of the pipe. Typically, data is written to a
PipedOutputStream object by one thread and data is
read from the connected
PipedInputStream by some
other thread. Attempting to use both objects from a single thread
is not recommended as it may deadlock the thread.
The pipe is said to be
broken if a
thread that was reading data bytes from the connected piped input
stream is no longer alive.
| Constructor: |
public PipedOutputStream() {
}
Creates a piped output stream that is not yet connected to a
piped input stream. It must be connected to a piped input stream,
either by the receiver or the sender, before being used. Also see:
- java.io.PipedInputStream#connect(java.io.PipedOutputStream)
- java.io.PipedOutputStream#connect(java.io.PipedInputStream)
|
public PipedOutputStream(PipedInputStream snk) throws IOException {
connect(snk);
}
Creates a piped output stream connected to the specified piped
input stream. Data bytes written to this stream will then be
available as input from snk. Parameters:
snk - The piped input stream to connect to.
Throws:
IOException - if an I/O error occurs.
- exception:
IOException - if an I/O error occurs.
|
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |