Class java.io.PipedInputStream
All Packages    This Package    Previous    Next

Class java.io.PipedInputStream

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.PipedInputStream

public class PipedInputStream
extends InputStream
Piped input stream, must be connected to a PipedOutputStream to be useful.
See Also:
PipedOutputStream, Piped
Version:
95/02/27
Author:
James Gosling

PipedInputStream(PipedOutputStream)
Creates an input file given a PiledOutputStream.
PipedInputStream()
Creates an input file that isn't connected to anything (yet).

close()
Closes the input stream.
connect(PipedOutputStream)
Connect this input stream to a sender.
read()
Reads a byte.
read(byte[], int, int)
Reads into an array of bytes.

PipedInputStream
  public PipedInputStream(PipedOutputStream src)
Creates an input file given a PiledOutputStream.
Parameters:
stream - the stream to connect to.

PipedInputStream

  public PipedInputStream()
Creates an input file that isn't connected to anything (yet). It must be connected to a PipedOutputStream before being used.

connect
  public void connect(PipedOutputStream src)
Connect this input stream to a sender.
Parameters:
src - The OutpueStream to connect to.

read

  public synchronized int read()
Reads a byte. Will block if no input is available.
Returns:
the byte read, or -1 if the end of the stream is reached.
Overrides:
read in class InputStream

read

  public synchronized int read(byte b[],
                               int off,
                               int len)
Reads into an array of bytes. Blocks until some input is available. For efficiency,this method should be overridden in a subclass (the default implementation reads 1 byte at a time).
Parameters:
b - the buffer into which the data is read
off - the start offset of the data
len - the maximum number of bytes read
Returns:
the actual number of bytes read, -1 is returned when the end of the stream is reached.
Throws: IOException
i/o error occurred
Overrides:
read in class InputStream

close

  public void close()
Closes the input stream. Must be called to release any resources associated with the stream.
Throws: IOException
i/o error occurred
Overrides:
close in class InputStream


All Packages    This Package    Previous    Next