Class java.io.PipedOutputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.io.PipedOutputStream

Object
   |
   +----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.

Version:
1.15, 07/01/98
Author:
James Gosling
Since:
JDK1.0
See Also:
PipedInputStream

Constructor Index

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

Method Index

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

Constructors

 o 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.
Since:
JDK1.0
 o 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.

Since:
JDK1.0
See Also:
connect(java.io.PipedOutputStream), connect(java.io.PipedInputStream)

Methods

 o 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
Since:
JDK1.0
 o 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.
Since:
JDK1.0
 o 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
Since:
JDK1.0
 o 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
Since:
JDK1.0
 o 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
Since:
JDK1.0

All Packages  Class Hierarchy  This Package  Previous  Next  Index