Where Am I? Class Hierarchy (JDK) All Classes (JDK) All Fields and Methods (JDK)

Class java.io.PipedOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----java.io.PipedOutputStream

public class PipedOutputStream
extends OutputStream

A piped output stream is the sending end of a communications pipe. Two threads can communicate by having one thread send data through a piped output stream and having the other thread read the data through a piped input stream.

Since:
JDK1.0
See Also:
PipedInputStream

Constructor Index

PipedOutputStream()
Creates a piped output stream that is not yet connected to a piped input stream.
PipedOutputStream(PipedInputStream)
Creates a piped output stream connected to the specified piped input stream.

Method Index

close()
Closes this piped output stream and releases any system resources associated with this stream.
connect(PipedInputStream)
Connects this piped output stream to a receiver.
flush()
Flushes this output stream and forces any buffered output bytes to be written out.
write(byte[], int, int)
Writes len bytes from the specified byte array starting at offset off to this piped output stream.
write(int)
Writes the specified byte to the piped output stream.

Constructors

PipedOutputStream
 public PipedOutputStream(PipedInputStream snk) throws IOException
Creates a piped output stream connected to the specified piped input stream.

Parameters:
snk - The piped input stream to connect to.
Throws: IOException
if an I/O error occurs.
PipedOutputStream
 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.

See Also:
connect, connect

Methods

connect
 public void connect(PipedInputStream snk) throws IOException
Connects this piped output stream to a receiver.

Parameters:
snk - the piped output stream to connect to.
Throws: IOException
if an I/O error occurs.
write
 public void write(int b) throws IOException
Writes the specified byte to the piped output stream.

Parameters:
b - the byte to be written.
Throws: IOException
if an I/O error occurs.
Overrides:
write in class OutputStream
write
 public void write(byte b[],
                   int off,
                   int len) throws IOException
Writes len bytes from the specified byte array starting at offset off to this piped output stream.

Parameters:
b - the data.
off - the start offset in the data.
len - the number of bytes to write.
Throws: IOException
if an I/O error occurs.
Overrides:
write in class OutputStream
flush
 public synchronized void flush() throws IOException
Flushes this output stream and forces any buffered output bytes to be written out. This will notify any readers that bytes are waiting in the pipe.

Throws: IOException
if an I/O error occurs.
Overrides:
flush in class OutputStream
close
 public void close() throws IOException
Closes this piped output stream and releases any system resources associated with this stream.

Throws: IOException
if an I/O error occurs.
Overrides:
close in class OutputStream

Where Am I? Class Hierarchy (JDK) All Classes (JDK) All Fields and Methods (JDK)