Package java.io Previous
Previous
Java API
Java API
Index
Index
Next
Next

Class PipedOutputStream

Constructors , Methods

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.


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 or the sender , before being used.


PipedOutputStream

public PipedOutputStream(PipedInputStream  snk) 
throws IOException 

Creates a piped output stream connected to the specified piped input stream.

ParameterDescription
snk The piped input stream to connect to.

Throw:

IOException

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.

Throw:

IOException

If an I/O error occurs.

Overrides:

close in class OutputStream .


connect

public void connect(PipedInputStream  snk) 
throws IOException 

Connects this piped output stream to a receivier

ParameterDescription
snk The piped output stream to connect to.

Throw:

IOException

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.

ParameterDescription
b the data
off the start offset in the data
len the number of bytes to write

Throw:

IOException

If an I/O error occurs.

Overrides:

write in class OutputStream .


write

public void write(int  b) 
throws IOException 

Writes the specified byte to the piped output stream.

ParameterDescription
b the byte to be written

Throw:

IOException

If an I/O error occurs.

Overrides:

write in class OutputStream .



Top© 1996 Sun Microsystems, Inc. All rights reserved.