Class ChannelInputStream

All Implemented Interfaces:
Closeable, AutoCloseable, IBufferHandler

public class ChannelInputStream extends BufferInputStream
An input stream that provides the buffers which arrive at a channel as a continuous byte sequence.
Author:
Eike Stepper
  • Constructor Details

    • ChannelInputStream

      public ChannelInputStream(IChannel channel)
    • ChannelInputStream

      public ChannelInputStream(IChannel channel, long millisBeforeTimeout)
  • Method Details

    • getChannel

      public IChannel getChannel()
    • getMillisBeforeTimeout

      public long getMillisBeforeTimeout()
      Overrides:
      getMillisBeforeTimeout in class BufferInputStream
    • setMillisBeforeTimeout

      public void setMillisBeforeTimeout(long millisBeforeTimeout)
    • getMillisInterruptCheck

      @Deprecated public long getMillisInterruptCheck()
      Deprecated.
      Periodic interrupt checks are no longer performed by BufferInputStream.
      Overrides:
      getMillisInterruptCheck in class BufferInputStream
      Since:
      2.0
    • setMillisInterruptCheck

      @Deprecated public void setMillisInterruptCheck(long millisInterruptCheck)
      Deprecated.
      Periodic interrupt checks are no longer performed by BufferInputStream; this value is retained only for compatibility with existing callers.
      Since:
      2.0
    • read

      public int read() throws IOException
      Description copied from class: BufferInputStream
      Returns the next byte, or IOUtil.EOF at end of stream.

      The monitor protects acquisition and access to the current buffer. If this method waits for a buffer, Object.wait() releases the monitor fully, including this method's reentrant acquisition, so producers and lifecycle operations can proceed. An exhausted buffer is detached under the monitor and released afterward.

      Overrides:
      read in class BufferInputStream
      Throws:
      IOException - if waiting for a buffer times out
    • toString

      public String toString()
      Overrides:
      toString in class BufferInputStream