Package org.apache.sshd.common.io
Interface IoReadFuture
- All Superinterfaces:
SshFuture<IoReadFuture>,VerifiableFuture<IoReadFuture>,WaitableFuture
- All Known Implementing Classes:
ChannelAsyncInputStream.IoReadFutureImpl
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the buffer data was read into.Returns the cause of the read failure.intgetRead()Retrieves the number of bytes read.Methods inherited from interface org.apache.sshd.common.future.SshFuture
addListener, removeListenerMethods inherited from interface org.apache.sshd.common.future.VerifiableFuture
verify, verify, verify, verifyMethods inherited from interface org.apache.sshd.common.future.WaitableFuture
await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getId, isDone
-
Method Details
-
getBuffer
Buffer getBuffer()Retrieves the buffer data was read into.- Returns:
- the buffer,
nullifWaitableFuture.isDone()== false
-
getRead
int getRead()Retrieves the number of bytes read.- 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
Throwable getException()Returns the cause of the read failure. AnEOFExceptionindicates that nothing was read because the source of the read is exhausted.- Returns:
nullif the read operation is not finished yet, or if the read attempt is successful (useWaitableFuture.isDone()to distinguish between the two).
-