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
- PipedOutputStream()
- Creates an output file that isn't connected to anything (yet).
- PipedOutputStream(PipedInputStream)
- Creates an output file connected to the specified PipedInputStream.
- close()
- Closes the stream.
- connect(PipedInputStream)
- Connect this output stream to a receiver.
- flush()
- Flushes the stream.
- write(byte[], int, int)
- Writes a sub array of bytes.
- write(int)
- Write a byte.
PipedOutputStream
public PipedOutputStream(PipedInputStream snk) throws IOException
- Creates an output file connected to the specified PipedInputStream.
- Parameters:
- snk - The InputStream to connect to.
PipedOutputStream
public PipedOutputStream()
- Creates an output file that isn't connected to anything (yet).
It must be connected before being used.
connect
public void connect(PipedInputStream snk) throws IOException
- Connect this output stream to a receiver.
- Parameters:
- snk - The InputStream to connect to.
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
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
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
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