Class ChannelAsyncInputStream.IoReadFutureImpl

All Implemented Interfaces:
SshFuture<IoReadFuture>, VerifiableFuture<IoReadFuture>, WaitableFuture, IoReadFuture
Enclosing class:
ChannelAsyncInputStream

public static class ChannelAsyncInputStream.IoReadFutureImpl extends DefaultVerifiableSshFuture<IoReadFuture> implements IoReadFuture
  • Field Details

    • buffer

      final Buffer buffer
  • Constructor Details

    • IoReadFutureImpl

      public IoReadFutureImpl(Object id, Buffer buffer)
  • Method Details

    • getBuffer

      public Buffer getBuffer()
      Description copied from interface: IoReadFuture
      Retrieves the buffer data was read into.
      Specified by:
      getBuffer in interface IoReadFuture
      Returns:
      the buffer, null if WaitableFuture.isDone() == false
    • verify

      public IoReadFuture verify(long timeoutMillis, CancelOption... options) throws IOException
      Description copied from interface: VerifiableFuture
      Wait and verify that the operation was successful
      Specified by:
      verify in interface VerifiableFuture<IoReadFuture>
      Parameters:
      timeoutMillis - Wait timeout in milliseconds
      options - Optional
      invalid reference
      CancelOptions
      defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
      Returns:
      The (same) future instance
      Throws:
      IOException - If failed to verify successfully on time
    • getRead

      public int getRead()
      Description copied from interface: IoReadFuture
      Retrieves the number of bytes read.
      Specified by:
      getRead in interface IoReadFuture
      Returns:
      The number of bytes read, or -1 if the source of the read has been exhausted (is at EOF), or zero if the read is not done yet (WaitableFuture.isDone() == false)
    • getException

      public Throwable getException()
      Description copied from interface: IoReadFuture
      Returns the cause of the read failure. An EOFException indicates that nothing was read because the source of the read is exhausted.
      Specified by:
      getException in interface IoReadFuture
      Returns:
      null if the read operation is not finished yet, or if the read attempt is successful (use WaitableFuture.isDone() to distinguish between the two).