org.jboss.xnio.channels
Interface ReadableAllocatedMessageChannel
- All Superinterfaces:
- java.nio.channels.Channel, java.io.Closeable, Configurable, SuspendableReadChannel
- All Known Subinterfaces:
- AllocatedMessageChannel
public interface ReadableAllocatedMessageChannel
- extends SuspendableReadChannel
A channel that can receive messages. Such a channel receives whole messages only; the messages are stored
in pre-filled and pre-sized buffers.
Method Summary |
java.nio.ByteBuffer |
receive()
Receive a message. |
Methods inherited from interface java.nio.channels.Channel |
close, isOpen |
receive
java.nio.ByteBuffer receive()
throws java.io.IOException
- Receive a message. The returned buffer's position is 0, the mark is not set, the limit is the size of the
received message, and the capacity is some value greater than or equal to the limit. If the request would
block, an empty buffer is returned. If the channel is closed from a read direction,
null
is returned.
- Returns:
- a buffer containing the received message, or
null
if the channel is at EOF
- Throws:
java.io.IOException
- if an I/O error occurs