| Package java.io |
Previous |
Java API |
Index |
Next |
public class java.io.PipedOutputStream
extends java.io.OutputStream
{
// Constructors
public PipedOutputStream();
public PipedOutputStream(PipedInputStream snk);
// Methods
public void close();
public void connect(PipedInputStream snk);
public void write(byte b[], int off, int len);
public void write(int b);
}
A piped output stream is the sending end 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.
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.
public PipedOutputStream(PipedInputStream snk)throws IOExceptionCreates a piped output stream connected to the specified piped input stream.
Parameter Description snk The piped input stream to connect to. Throw:
If an I/O error occurs.
public void close()throws IOExceptionCloses this piped output stream and releases any system resources associated with this stream.
Throw:
If an I/O error occurs.
Overrides:
close in class OutputStream .
public void connect(PipedInputStream snk)throws IOExceptionConnects this piped output stream to a receivier
Parameter Description snk The piped output stream to connect to. Throw:
If an I/O error occurs.
public void write(byte b[], int off, int len)throws IOExceptionWrites len bytes from the specified byte array starting at offset off to this piped output stream.
Parameter Description b the data off the start offset in the data len the number of bytes to write Throw:
If an I/O error occurs.
Overrides:
write in class OutputStream .
public void write(int b)throws IOExceptionWrites the specified byte to the piped output stream.
Parameter Description b the byte to be written Throw:
If an I/O error occurs.
Overrides:
write in class OutputStream .
| © 1996 Sun Microsystems, Inc. All rights reserved. |