    All Packages    This Package    Previous    Next

# 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 recieves data from a thread writing to the PipedOutputStream it is connected to.

See Also:
  PipedInputStream
Version:
  95/01/31
Author:
  James Gosling

##

PipedOutputStream(PipedInputStream)
  Creates an output file connected to a 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 reciever.
write(int)
  Write a byte.
write(byte[], int, int)
  Writes a sub array of bytes.

##

PipedOutputStream

      public PipedOutputStream(PipedInputStream snk)

  Creates an output file connected to a 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)

  Connect this output stream to a reciever.
  Parameters:
    snk - The InputStream to connect to.

write

      public void write(int b)

  Write a byte. Will block until the byte is actually written.
  Throws: IOException
    i/o error occurred
  Overrides:
    write in class OutputStream

write

      public void write(byte b[],
                        int off,
                        int len)

  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
    i/o error occurred
  Overrides:
    write in class OutputStream

close

      public void close()

  Closes the stream. This method must be called to release any resources associated with the stream.
  Throws: IOException
    i/o error occurred
  Overrides:
    close in class OutputStream

    All Packages    This Package    Previous    Next