XNIO version 1.2.0.GA

org.jboss.xnio.channels
Interface ReadableAllocatedMessageChannel

All Superinterfaces:
Channel, 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
 ByteBuffer receive()
          Receive a message.
 
Methods inherited from interface org.jboss.xnio.channels.SuspendableReadChannel
awaitReadable, awaitReadable, resumeReads, shutdownReads, suspendReads
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 
Methods inherited from interface org.jboss.xnio.channels.Configurable
getOption, getOptions, setOption
 

Method Detail

receive

ByteBuffer receive()
                   throws 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:
IOException - if an I/O error occurs

XNIO version 1.2.0.GA

Copyright © 2008 JBoss, a division of Red Hat, Inc.