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(PipedInputStream)
- Creates an output file connected to the specified
PipedInputStream.
-
PipedOutputStream()
- Creates an output file that isn't connected to anything (yet).
-
close()
- Closes the stream.
-
connect(PipedInputStream)
- Connect this output stream to a receiver.
-
write(int)
- Write a byte.
-
write(byte[], int, int)
- Writes a sub array of bytes.
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
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