XNIO version 1.1.0.GA

org.jboss.xnio.channels
Interface ReadableMessageChannel

All Superinterfaces:
Channel, Closeable, Configurable, SuspendableReadChannel
All Known Subinterfaces:
DatagramChannel<A>, MessageChannel

public interface ReadableMessageChannel
extends SuspendableReadChannel, Configurable

A channel that can receive messages. Such a channel receives whole messages only.


Method Summary
 int receive(ByteBuffer buffer)
          Receive a message.
 int receive(ByteBuffer[] buffers)
          Receive a message.
 int receive(ByteBuffer[] buffers, int offs, int len)
          Receive a message.
 
Methods inherited from interface org.jboss.xnio.channels.SuspendableReadChannel
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

int receive(ByteBuffer buffer)
            throws IOException
Receive a message.

Parameters:
buffer - the buffer that will hold the message
Returns:
the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
Throws:
IOException - if an I/O error occurs

receive

int receive(ByteBuffer[] buffers)
            throws IOException
Receive a message.

Parameters:
buffers - the buffers that will hold the message
Returns:
the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
Throws:
IOException - if an I/O error occurs

receive

int receive(ByteBuffer[] buffers,
            int offs,
            int len)
            throws IOException
Receive a message.

Parameters:
buffers - the buffers that will hold the message
offs - the offset into the array of buffers of the first buffer to read into
len - the number of buffers to fill
Returns:
the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
Throws:
IOException - if an I/O error occurs

XNIO version 1.1.0.GA

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