Packages  This Package  Prev  Next  Index  

§2.17 Class PipedOutputStream

public  class  java.io.PipedOutputStream
    extends  java.io.OutputStream  (I-§2.15)
{
        // Constructors
    public PipedOutputStream();	§2.17.1
    public PipedOutputStream(PipedInputStream  snk);	§2.17.2

        // Methods
    public void close();	§2.17.3
    public void connect(PipedInputStream  snk);	§2.17.4
    public void write(byte  b[], int  off, int  len);	§2.17.5
    public void write(int  b);	§2.17.6
}
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 (I-§2.16) and having the other thread read the data through a piped input stream.


Constructors

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 (I-§2.16.4) or the sender (I-§2.17.4), before being used.

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 (I-§2.29)
If an I/O error occurs.

Methods

close

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

connect

public void connect(PipedInputStream snk) throws IOException
Connects this piped output stream to a receivier
Parameters:
snk - The piped output stream to connect to.
Throws
IOException (I-§2.29)
If an I/O error occurs.

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 (I-§2.29)
If an I/O error occurs.
Overrides:
write in class OutputStream (I-§2.15.5).

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 (I-§2.29)
If an I/O error occurs.
Overrides:
write in class OutputStream (I-§2.15.6).

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com