public class ByteBufferMessage extends Object implements Message
A Simple implementation of the message interface for small messages. When the readData methods are called we assume the message is complete. i.e there want be any appendData operations after that.
If you need large message support please see
FileMessage and StreamingMessage
| Constructor and Description |
|---|
ByteBufferMessage() |
ByteBufferMessage(int transferId) |
ByteBufferMessage(MessageProperties messageProperties,
DeliveryProperties deliveryProperties) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendData(byte[] src) |
void |
appendData(ByteBuffer src)
write the data from the current position up to the buffer limit
|
void |
clearData() |
DeliveryProperties |
getDeliveryProperties() |
Header |
getHeader() |
MessageProperties |
getMessageProperties() |
int |
getMessageTransferId() |
ByteBuffer |
readData() |
void |
readData(byte[] target) |
void |
setDeliveryProperties(DeliveryProperties props) |
void |
setHeader(Header header) |
void |
setMessageProperties(MessageProperties props) |
String |
toString() |
public ByteBufferMessage(MessageProperties messageProperties, DeliveryProperties deliveryProperties)
public ByteBufferMessage()
public ByteBufferMessage(int transferId)
public int getMessageTransferId()
getMessageTransferId in interface Messagepublic void appendData(byte[] src)
throws IOException
appendData in interface MessageIOExceptionpublic void appendData(ByteBuffer src) throws IOException
appendData in interface MessageIOExceptionpublic DeliveryProperties getDeliveryProperties()
getDeliveryProperties in interface Messagepublic MessageProperties getMessageProperties()
getMessageProperties in interface Messagepublic void setDeliveryProperties(DeliveryProperties props)
public void setMessageProperties(MessageProperties props)
public ByteBuffer readData()
Copyright © 2006–2015 The Apache Software Foundation. All rights reserved.