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

Class java.io.PipedOutputStream

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

public class PipedOutputStream
extends OutputStream
Piped output stream, must be connected to a PipedInputStream. A thread reading from a PipedInputStream receives data from a thread writing to the PipedOutputStream it is connected to.
See Also:
PipedInputStream

Constructor Index

 o PipedOutputStream()
Creates an output file that isn't connected to anything (yet).
 o PipedOutputStream(PipedInputStream)
Creates an output file connected to the specified PipedInputStream.

Method Index

 o close()
Closes the stream.
 o connect(PipedInputStream)
Connect this output stream to a receiver.
 o flush()
Flushes the stream.
 o write(byte[], int, int)
Writes a sub array of bytes.
 o write(int)
Write a byte.

Constructors

 o PipedOutputStream
public PipedOutputStream(PipedInputStream snk) throws IOException
Creates an output file connected to the specified PipedInputStream.
Parameters:
snk - The InputStream to connect to.
 o PipedOutputStream
public PipedOutputStream()
Creates an output file that isn't connected to anything (yet). It must be connected before being used.

Methods

 o connect
public void connect(PipedInputStream snk) throws IOException
Connect this output stream to a receiver.
Parameters:
snk - The InputStream to connect to.
 o write
public void write(int b) throws IOException
Write a byte. This method will block until the byte is actually written.
Parameters:
b - the byte to be written
Throws: IOException
If an I/O error has occurred.
Overrides:
write in class OutputStream
 o write
public void write(byte b[],
                    int off,
                    int len) throws IOException
Writes a sub array of bytes.
Parameters:
b - the data to be written
off - the start offset in the data
len - the number of bytes that are written
Throws: IOException
If an I/O error has occurred.
Overrides:
write in class OutputStream
 o flush
public synchronized void flush() throws IOException
Flushes the stream. This will notify any readers that bytes are waiting in the pipe.
Throws: IOException
If an I/O error has occurred.
Overrides:
flush in class OutputStream
 o close
public void close() throws IOException
Closes the stream. This method must be called to release any resources associated with the stream.
Throws: IOException
If an I/O error has occurred.
Overrides:
close in class OutputStream

All Packages  Class Hierarchy  This Package  Previous  Next  Index