gov.lbl.dsd.sea.nio.event
Class ChannelResponse.Read
java.lang.Object
gov.lbl.dsd.sea.nio.event.ChannelResponse
gov.lbl.dsd.sea.nio.event.ChannelResponse.Read
- Enclosing class:
- ChannelResponse
- public static class ChannelResponse.Read
- extends ChannelResponse
Contains a buffer with the non-blocking data read from the given channel
(originally initiated by a prior ChannelRequest.Register
request
containing SelectionKey
OP_READ ops); The data
has buffer.remaining()
bytes, and is contained between
indexes 0 == buffer.position()
and buffer.limit()
,
as usual with NIO; A buffer with !buffer.hasRemaining()
indicates that end-of-stream has been reached for the given channel.
Once your application has completely processed the contained buffer, you
can for efficiency consider reusing it (e.g. via a buffer pool).
ChannelResponse.Read
public ChannelResponse.Read(NetAgent agent,
SelectionKey key,
IOException exception,
ByteBuffer buffer)
getBuffer
public ByteBuffer getBuffer()
toString
public String toString()
- Overrides:
toString
in class ChannelResponse