org.apache.qpid.nclient.util
Class ByteBufferMessage
java.lang.Object
org.apache.qpid.nclient.util.ByteBufferMessage
- All Implemented Interfaces:
- org.apache.qpid.api.Message
public class ByteBufferMessage
- extends Object
- implements org.apache.qpid.api.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
ByteBufferMessage
public ByteBufferMessage(org.apache.qpid.transport.MessageProperties messageProperties,
org.apache.qpid.transport.DeliveryProperties deliveryProperties)
ByteBufferMessage
public ByteBufferMessage()
ByteBufferMessage
public ByteBufferMessage(int transferId)
setHeader
public void setHeader(org.apache.qpid.transport.Header header)
- Specified by:
setHeader
in interface org.apache.qpid.api.Message
getHeader
public org.apache.qpid.transport.Header getHeader()
- Specified by:
getHeader
in interface org.apache.qpid.api.Message
getMessageTransferId
public int getMessageTransferId()
- Specified by:
getMessageTransferId
in interface org.apache.qpid.api.Message
clearData
public void clearData()
- Specified by:
clearData
in interface org.apache.qpid.api.Message
appendData
public void appendData(byte[] src)
throws IOException
- Specified by:
appendData
in interface org.apache.qpid.api.Message
- Throws:
IOException
appendData
public void appendData(ByteBuffer src)
throws IOException
- write the data from the current position up to the buffer limit
- Specified by:
appendData
in interface org.apache.qpid.api.Message
- Throws:
IOException
getDeliveryProperties
public org.apache.qpid.transport.DeliveryProperties getDeliveryProperties()
- Specified by:
getDeliveryProperties
in interface org.apache.qpid.api.Message
getMessageProperties
public org.apache.qpid.transport.MessageProperties getMessageProperties()
- Specified by:
getMessageProperties
in interface org.apache.qpid.api.Message
setDeliveryProperties
public void setDeliveryProperties(org.apache.qpid.transport.DeliveryProperties props)
setMessageProperties
public void setMessageProperties(org.apache.qpid.transport.MessageProperties props)
readData
public void readData(byte[] target)
- Specified by:
readData
in interface org.apache.qpid.api.Message
readData
public ByteBuffer readData()
- Specified by:
readData
in interface org.apache.qpid.api.Message
toString
public String toString()
- Overrides:
toString
in class Object
Licensed to the Apache Software Foundation