Package org.dellroad.stuff.io
Interface AsyncInputStream.Listener
- All Known Implementing Classes:
IdleTimeoutInputStream
- Enclosing class:
- AsyncInputStream
public static interface AsyncInputStream.Listener
Callback interface required by
AsyncInputStream
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Handle end-of-file detected on the underlying input.void
Handle an exception detected on the underlying input.void
handleInput
(byte[] buf, int off, int len) Handle new data read from the underlying input.
-
Method Details
-
handleInput
void handleInput(byte[] buf, int off, int len) Handle new data read from the underlying input. This method must not write to buffer bytes outside of the defined region.- Parameters:
buf
- data bufferoff
- starting offset of data in bufferlen
- number of bytes of data
-
handleException
Handle an exception detected on the underlying input. No further events will be delivered.Typically the assocaited
AsyncInputStream
will be closed in this callback.- Parameters:
e
- the exception received (usuallyIOException
but could also be any otherRuntimeException
)
-
handleEOF
void handleEOF()Handle end-of-file detected on the underlying input. No further events will be delivered.Typically the assocaited
AsyncInputStream
will be closed in this callback.
-