Package org.xnio.conduits

# Interface MessageSourceConduit

All Superinterfaces:
  `Conduit`, `SourceConduit`

All Known Implementing Classes:
  `AbstractMessageSourceConduit`, `FramingMessageSourceConduit`, `SynchronizedMessageSourceConduit`

public interface MessageSourceConduit extends SourceConduit
A message source conduit.

Author:
  David M. Lloyd

## Method Summary

Modifier and Type
Method
Description
`int`
`receive(ByteBuffer dst)`
Receive a message.
`long`
`receive(ByteBuffer[] dsts, int offs, int len)`
Receive a message.

### Methods inherited from interface org.xnio.conduits.Conduit

`getWorker`

### Methods inherited from interface org.xnio.conduits.SourceConduit

`awaitReadable, awaitReadable, getReadThread, isReadResumed, isReadShutdown, resumeReads, setReadReadyHandler, suspendReads, terminateReads, wakeupReads`

## Method Details

### receive

int receive(ByteBuffer dst) 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

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

Parameters:
  `offs` - the offset into the array of buffers of the first buffer to read into
  `len` - the number of buffers to fill
  `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