All Implemented Interfaces:
Closeable, AutoCloseable

  • Field Summary

    Fields

    protected byte[]

    The circular buffer into which incoming data is placed.

    protected int

    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

    The index of the position in the circular buffer at which the next byte of data will be read by this piped input stream.

    protected static final int

    The default size of the pipe's circular input buffer.

  • Constructor Summary

    Constructors

    Creates a PipedInputStream so that it is not yet connected.

    PipedInputStream(int pipeSize)

    Creates a PipedInputStream so that it is not yet connected and uses the specified pipe size for the pipe's buffer.

    Creates a PipedInputStream so that it is connected to the piped output stream src.

    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.

  • Method Summary

    int

    available()

    Returns the number of bytes that can be read from this input stream without blocking.

    void

    close()

    Closes this input stream and releases any system resources associated with the stream.

    void

    Causes this piped input stream to be connected to the piped output stream src.

    int

    read()

    Reads the next byte of data from this piped input stream.

    int

    read(byte[] b, int off, int len)

    Reads up to len bytes of data from this piped input stream into an array of bytes.

    protected void

    receive(int b)

  • Field Details

    • PIPE_SIZE

    • buffer

    • in

    • out

  • Constructor Details

    • PipedInputStream

    • PipedInputStream

    • PipedInputStream

    • PipedInputStream

  • Method Details

    • connect

    • receive

    • read

    • read

    • available

    • close