API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.io. PipedInputStream View Source
Author(s)
James Gosling
Since
JDK1.0
Version
1.40, 12/01/05
Serial
Hierarchy
 Object
      InputStream
          PipedInputStream
Implements
Subclasses
Description
public class PipedInputStream
  A piped input stream should be connected to a piped output stream; the piped input stream then provides whatever data bytes are written to the piped output stream.
See also:    PipedOutputStream
Constructors
public PipedInputStream ()
  Creates a PipedInputStream so that it is not yet connected.
public PipedInputStream (int pipeSize)
  Creates a PipedInputStream so that it is not yet connected and uses the specified pipe size for the pipe's buffer.
public PipedInputStream (PipedOutputStream src) throws IOException
  Creates a PipedInputStream so that it is connected to the piped output stream src.
public PipedInputStream (PipedOutputStream src, int pipeSize) throws IOException
  Creates a PipedInputStream so that it is connected to the piped output stream src and uses the specified pipe size for the pipe's buffer.
Methods
Hide/Show inherited methods
publicsynchronized int available () throws IOException [Overrides InputStream]
  Returns the number of bytes that can be read from this input stream without blocking.
public void close () throws IOException [Overrides InputStream]
  Closes this piped input stream and releases any system resources associated with the stream.
public void connect (PipedOutputStream src) throws IOException
  Causes this piped input stream to be connected to the piped output stream src.
publicsynchronized void mark (int readlimit) [Inherited From InputStream]
  Marks the current position in this input stream.
public boolean markSupported () [Inherited From InputStream]
  Tests if this input stream supports the mark and reset methods.
publicsynchronized int read () throws IOException [Specified in InputStream]
  Reads the next byte of data from this piped input stream.
public int read (byte[] b) throws IOException [Inherited From InputStream]
  Reads some number of bytes from the input stream and stores them into the buffer array b.
publicsynchronized int read (byte[] b, int off, int len) throws IOException [Overrides InputStream]
  Reads up to len bytes of data from this piped input stream into an array of bytes.
pack-privatesynchronized void receive (byte[] b, int off, int len) throws IOException
  Receives data into an array of bytes.
protectedsynchronized void receive (int b) throws IOException
  Receives a byte of data.
pack-privatesynchronized void receivedLast ()
Notifies all waiting threads that the last byte of data has been received.
publicsynchronized void reset () throws IOException [Inherited From InputStream]
  Repositions this stream to the position at the time the mark method was last called on this input stream.
public long skip (long n) throws IOException [Inherited From InputStream]
  Skips over and discards n bytes of data from this input stream.
Fields
Hide/Show inherited fields
protected byte buffer
  The circular buffer into which incoming data is placed.
pack-privatevolatile boolean closedByReader
pack-private boolean closedByWriter
pack-private boolean connected
protected int in
  The index of the position in the circular buffer at which the next byte of data will be stored when received from the connected piped output stream.
protected int out
  The index of the position in the circular buffer at which the next byte of data will be read by this piped input stream.
protectedfinalstatic int PIPE_SIZE = "1024"
  The default size of the pipe's circular input buffer.
pack-private Thread readSide
pack-private Thread writeSide
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar