Class ReadableChannelOverIterator<T>

All Implemented Interfaces:
Closeable, AutoCloseable, Channel, HasArrayOps<T[]>, ReadableChannel<T[]>, ReadableSource<T[]>

public class ReadableChannelOverIterator<T> extends ReadableChannelBase<T[]>
  • Field Details

    • arrayOps

      protected ArrayOps<T[]> arrayOps
    • iterator

      protected Iterator<T> iterator
    • closeAction

      protected Runnable closeAction
  • Constructor Details

    • ReadableChannelOverIterator

      public ReadableChannelOverIterator(ArrayOps<T[]> arrayOps, Iterator<T> it, Runnable closeAction)
  • Method Details

    • setCloseAction

      public void setCloseAction(Runnable closeAction)
    • toStream

      public Stream<T> toStream()
      Returns this channel as a stream - closing the stream closes this channel
    • getIterator

      public Iterator<T> getIterator()
    • closeActual

      public void closeActual() throws IOException
      Overrides:
      closeActual in class AutoCloseableBase
      Throws:
      IOException
    • read

      public int read(T[] array, int position, int length) throws IOException
      Description copied from interface: ReadableSource
      Read method following the usual InputStream protocol.
      Parameters:
      array - The array into which to put the read data
      position - Offset into array where to start writing
      length - Maximum number of items to read.
      Returns:
      The number of items read. Return -1 if end of data was reached, and 0 iff length was 0.
      Throws:
      IOException
    • getArrayOps

      public ArrayOps<T[]> getArrayOps()