activemq-cpp-3.9.0
activemq::commands::ActiveMQBytesMessage Class Reference

#include <src/main/activemq/commands/ActiveMQBytesMessage.h>

Inheritance diagram for activemq::commands::ActiveMQBytesMessage:

Public Member Functions

 ActiveMQBytesMessage ()
 
virtual ~ActiveMQBytesMessage () throw ()
 
virtual unsigned char getDataStructureType () const
 Get the DataStructure Type as defined in CommandTypes.h. More...
 
virtual ActiveMQBytesMessagecloneDataStructure () const
 Clone this obbject and return a new instance that the caller now owns, this will be an exact copy of this one. More...
 
virtual void copyDataStructure (const DataStructure *src)
 Copy the contents of the passed object into this objects members, overwriting any existing data. More...
 
virtual std::string toString () const
 Returns a string containing the information for this DataStructure such as its type and value of its elements. More...
 
virtual bool equals (const DataStructure *value) const
 Compares the DataStructure passed in to this one, and returns if they are equivalent. More...
 
virtual cms::BytesMessageclone () const
 Clones this message. More...
 
virtual void clearBody ()
 Clears out the body of the message. More...
 
virtual void onSend ()
 Allows derived Message classes to perform tasks before a message is sent. More...
 
virtual void setBodyBytes (const unsigned char *buffer, int numBytes)
 sets the bytes given to the message body. More...
 
virtual unsigned char * getBodyBytes () const
 Gets the bytes that are contained in this message and returns them in a newly allocated array that becomes the property of the caller. More...
 
virtual int getBodyLength () const
 Returns the number of bytes contained in the body of this message. More...
 
virtual void reset ()
 Puts the message body in read-only mode and repositions the stream of bytes to the beginning. More...
 
virtual bool readBoolean () const
 Reads a Boolean from the Bytes message stream. More...
 
virtual void writeBoolean (bool value)
 Writes a boolean to the bytes message stream as a 1-byte value. More...
 
virtual unsigned char readByte () const
 Reads a Byte from the Bytes message stream. More...
 
virtual void writeByte (unsigned char value)
 Writes a byte to the bytes message stream as a 1-byte value. More...
 
virtual int readBytes (std::vector< unsigned char > &value) const
 Reads a byte array from the bytes message stream. More...
 
virtual void writeBytes (const std::vector< unsigned char > &value)
 Writes a byte array to the bytes message stream using the vector size as the number of bytes to write. More...
 
virtual int readBytes (unsigned char *buffer, int length) const
 Reads a portion of the bytes message stream. More...
 
virtual void writeBytes (const unsigned char *value, int offset, int length)
 Writes a portion of a byte array to the bytes message stream. More...
 
virtual char readChar () const
 Reads a Char from the Bytes message stream. More...
 
virtual void writeChar (char value)
 Writes a char to the bytes message stream as a 1-byte value. More...
 
virtual float readFloat () const
 Reads a 32 bit float from the Bytes message stream. More...
 
virtual void writeFloat (float value)
 Writes a float to the bytes message stream as a 4 byte value. More...
 
virtual double readDouble () const
 Reads a 64 bit double from the Bytes message stream. More...
 
virtual void writeDouble (double value)
 Writes a double to the bytes message stream as a 8 byte value. More...
 
virtual short readShort () const
 Reads a 16 bit signed short from the Bytes message stream. More...
 
virtual void writeShort (short value)
 Writes a signed short to the bytes message stream as a 2 byte value. More...
 
virtual unsigned short readUnsignedShort () const
 Reads a 16 bit unsigned short from the Bytes message stream. More...
 
virtual void writeUnsignedShort (unsigned short value)
 Writes a unsigned short to the bytes message stream as a 2 byte value. More...
 
virtual int readInt () const
 Reads a 32 bit signed integer from the Bytes message stream. More...
 
virtual void writeInt (int value)
 Writes a signed int to the bytes message stream as a 4 byte value. More...
 
virtual long long readLong () const
 Reads a 64 bit long from the Bytes message stream. More...
 
virtual void writeLong (long long value)
 Writes a long long to the bytes message stream as a 8 byte value. More...
 
virtual std::string readString () const
 Reads an ASCII String from the Bytes message stream. More...
 
virtual void writeString (const std::string &value)
 Writes an ASCII String to the Bytes message stream. More...
 
virtual std::string readUTF () const
 Reads an UTF String from the BytesMessage stream. More...
 
virtual void writeUTF (const std::string &value)
 Writes an UTF String to the BytesMessage stream. More...
 
- Public Member Functions inherited from activemq::commands::ActiveMQMessageTemplate< cms::BytesMessage >
 ActiveMQMessageTemplate ()
 
virtual ~ActiveMQMessageTemplate () throw ()
 
virtual void acknowledge () const
 
virtual void clearProperties ()
 
virtual std::vector< std::string > getPropertyNames () const
 
virtual bool propertyExists (const std::string &name) const
 
virtual cms::Message::ValueType getPropertyValueType (const std::string &name) const
 
virtual bool getBooleanProperty (const std::string &name) const
 
virtual unsigned char getByteProperty (const std::string &name) const
 
virtual double getDoubleProperty (const std::string &name) const
 
virtual float getFloatProperty (const std::string &name) const
 
virtual int getIntProperty (const std::string &name) const
 
virtual long long getLongProperty (const std::string &name) const
 
virtual short getShortProperty (const std::string &name) const
 
virtual std::string getStringProperty (const std::string &name) const
 
virtual void setBooleanProperty (const std::string &name, bool value)
 
virtual void setByteProperty (const std::string &name, unsigned char value)
 
virtual void setDoubleProperty (const std::string &name, double value)
 
virtual void setFloatProperty (const std::string &name, float value)
 
virtual void setIntProperty (const std::string &name, int value)
 
virtual void setLongProperty (const std::string &name, long long value)
 
virtual void setShortProperty (const std::string &name, short value)
 
virtual void setStringProperty (const std::string &name, const std::string &value)
 
virtual std::string getCMSCorrelationID () const
 
virtual void setCMSCorrelationID (const std::string &correlationId)
 
virtual int getCMSDeliveryMode () const
 
virtual void setCMSDeliveryMode (int mode)
 
virtual const cms::DestinationgetCMSDestination () const
 
virtual void setCMSDestination (const cms::Destination *destination)
 
virtual long long getCMSExpiration () const
 
virtual void setCMSExpiration (long long expireTime)
 
virtual std::string getCMSMessageID () const
 
virtual void setCMSMessageID (const std::string &value)
 
virtual int getCMSPriority () const
 
virtual void setCMSPriority (int priority)
 
virtual bool getCMSRedelivered () const
 
virtual void setCMSRedelivered (bool redelivered AMQCPP_UNUSED)
 
virtual const cms::DestinationgetCMSReplyTo () const
 
virtual void setCMSReplyTo (const cms::Destination *destination)
 
virtual long long getCMSTimestamp () const
 
virtual void setCMSTimestamp (long long timeStamp)
 
virtual std::string getCMSType () const
 
virtual void setCMSType (const std::string &type)
 
- Public Member Functions inherited from cms::BytesMessage
virtual ~BytesMessage ()
 
- Public Member Functions inherited from cms::Message
virtual ~Message ()
 
- Public Member Functions inherited from activemq::commands::Message
 Message ()
 
virtual ~Message ()
 
Pointer< Messagecopy () const
 Create a Pointer based copy of this message. More...
 
virtual void beforeMarshal (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
 Handles the marshaling of the objects properties into the internal byte array before the object is marshaled to the wire. More...
 
virtual void afterUnmarshal (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
 Called after unmarshaling is started to cleanup the object being unmarshaled. More...
 
virtual bool isMarshalAware () const
 Indicates that this command is aware of Marshaling, and needs to have its Marshaling methods invoked. More...
 
virtual void setAckHandler (const Pointer< core::ActiveMQAckHandler > &handler)
 Sets the Acknowledgment Handler that this Message will use when the Acknowledge method is called. More...
 
virtual Pointer
< core::ActiveMQAckHandler
getAckHandler () const
 Gets the Acknowledgment Handler that this Message will use when the Acknowledge method is called. More...
 
void setConnection (core::ActiveMQConnection *connection)
 Sets the ActiveMQConnection instance that this Command was created from when the session create methods are called to create a Message. More...
 
core::ActiveMQConnectiongetConnection () const
 Gets the ActiveMQConnection instance that this Command was created from when the session create methods are called to create a Message. More...
 
virtual unsigned int getSize () const
 Returns the Size of this message in Bytes. More...
 
virtual bool isExpired () const
 Returns if this message has expired, meaning that its Expiration time has elapsed. More...
 
util::PrimitiveMapgetMessageProperties ()
 Gets a reference to the Message's Properties object, allows the derived classes to get and set their own specific properties. More...
 
const util::PrimitiveMapgetMessageProperties () const
 
bool isReadOnlyProperties () const
 Returns if the Message Properties Are Read Only. More...
 
void setReadOnlyProperties (bool value)
 Set the Read Only State of the Message Properties. More...
 
bool isReadOnlyBody () const
 Returns if the Message Body is Read Only. More...
 
void setReadOnlyBody (bool value)
 Set the Read Only State of the Message Content. More...
 
virtual const Pointer
< ProducerId > & 
getProducerId () const
 
virtual Pointer< ProducerId > & getProducerId ()
 
virtual void setProducerId (const Pointer< ProducerId > &producerId)
 
virtual const Pointer
< ActiveMQDestination > & 
getDestination () const
 
virtual Pointer
< ActiveMQDestination > & 
getDestination ()
 
virtual void setDestination (const Pointer< ActiveMQDestination > &destination)
 
virtual const Pointer
< TransactionId > & 
getTransactionId () const
 
virtual Pointer< TransactionId > & getTransactionId ()
 
virtual void setTransactionId (const Pointer< TransactionId > &transactionId)
 
virtual const Pointer
< ActiveMQDestination > & 
getOriginalDestination () const
 
virtual Pointer
< ActiveMQDestination > & 
getOriginalDestination ()
 
virtual void setOriginalDestination (const Pointer< ActiveMQDestination > &originalDestination)
 
virtual const Pointer
< MessageId > & 
getMessageId () const
 
virtual Pointer< MessageId > & getMessageId ()
 
virtual void setMessageId (const Pointer< MessageId > &messageId)
 
virtual const Pointer
< TransactionId > & 
getOriginalTransactionId () const
 
virtual Pointer< TransactionId > & getOriginalTransactionId ()
 
virtual void setOriginalTransactionId (const Pointer< TransactionId > &originalTransactionId)
 
virtual const std::string & getGroupID () const
 
virtual std::string & getGroupID ()
 
virtual void setGroupID (const std::string &groupID)
 
virtual int getGroupSequence () const
 
virtual void setGroupSequence (int groupSequence)
 
virtual const std::string & getCorrelationId () const
 
virtual std::string & getCorrelationId ()
 
virtual void setCorrelationId (const std::string &correlationId)
 
virtual bool isPersistent () const
 
virtual void setPersistent (bool persistent)
 
virtual long long getExpiration () const
 
virtual void setExpiration (long long expiration)
 
virtual unsigned char getPriority () const
 
virtual void setPriority (unsigned char priority)
 
virtual const Pointer
< ActiveMQDestination > & 
getReplyTo () const
 
virtual Pointer
< ActiveMQDestination > & 
getReplyTo ()
 
virtual void setReplyTo (const Pointer< ActiveMQDestination > &replyTo)
 
virtual long long getTimestamp () const
 
virtual void setTimestamp (long long timestamp)
 
virtual const std::string & getType () const
 
virtual std::string & getType ()
 
virtual void setType (const std::string &type)
 
virtual const std::vector
< unsigned char > & 
getContent () const
 
virtual std::vector< unsigned
char > & 
getContent ()
 
virtual void setContent (const std::vector< unsigned char > &content)
 
virtual const std::vector
< unsigned char > & 
getMarshalledProperties () const
 
virtual std::vector< unsigned
char > & 
getMarshalledProperties ()
 
virtual void setMarshalledProperties (const std::vector< unsigned char > &marshalledProperties)
 
virtual const Pointer
< DataStructure > & 
getDataStructure () const
 
virtual Pointer< DataStructure > & getDataStructure ()
 
virtual void setDataStructure (const Pointer< DataStructure > &dataStructure)
 
virtual const Pointer
< ConsumerId > & 
getTargetConsumerId () const
 
virtual Pointer< ConsumerId > & getTargetConsumerId ()
 
virtual void setTargetConsumerId (const Pointer< ConsumerId > &targetConsumerId)
 
virtual bool isCompressed () const
 
virtual void setCompressed (bool compressed)
 
virtual int getRedeliveryCounter () const
 
virtual void setRedeliveryCounter (int redeliveryCounter)
 
virtual const std::vector
< decaf::lang::Pointer
< BrokerId > > & 
getBrokerPath () const
 
virtual std::vector
< decaf::lang::Pointer
< BrokerId > > & 
getBrokerPath ()
 
virtual void setBrokerPath (const std::vector< decaf::lang::Pointer< BrokerId > > &brokerPath)
 
virtual long long getArrival () const
 
virtual void setArrival (long long arrival)
 
virtual const std::string & getUserID () const
 
virtual std::string & getUserID ()
 
virtual void setUserID (const std::string &userID)
 
virtual bool isRecievedByDFBridge () const
 
virtual void setRecievedByDFBridge (bool recievedByDFBridge)
 
virtual bool isDroppable () const
 
virtual void setDroppable (bool droppable)
 
virtual const std::vector
< decaf::lang::Pointer
< BrokerId > > & 
getCluster () const
 
virtual std::vector
< decaf::lang::Pointer
< BrokerId > > & 
getCluster ()
 
virtual void setCluster (const std::vector< decaf::lang::Pointer< BrokerId > > &cluster)
 
virtual long long getBrokerInTime () const
 
virtual void setBrokerInTime (long long brokerInTime)
 
virtual long long getBrokerOutTime () const
 
virtual void setBrokerOutTime (long long brokerOutTime)
 
virtual bool isJMSXGroupFirstForConsumer () const
 
virtual void setJMSXGroupFirstForConsumer (bool jMSXGroupFirstForConsumer)
 
virtual bool isMessage () const
 
virtual Pointer< Commandvisit (activemq::state::CommandVisitor *visitor)
 Allows a Visitor to visit this command and return a response to the command based on the command type being visited. More...
 
- Public Member Functions inherited from activemq::commands::BaseCommand
 BaseCommand ()
 
virtual ~BaseCommand ()
 
virtual void setCommandId (int id)
 Sets the Command Id of this Message. More...
 
virtual int getCommandId () const
 Gets the Command Id of this Message. More...
 
virtual void setResponseRequired (const bool required)
 Set if this Message requires a Response. More...
 
virtual bool isResponseRequired () const
 Is a Response required for this Command. More...
 
virtual bool isBrokerInfo () const
 
virtual bool isControlCommand () const
 
virtual bool isConnectionControl () const
 
virtual bool isConnectionError () const
 
virtual bool isConnectionInfo () const
 
virtual bool isConsumerInfo () const
 
virtual bool isConsumerControl () const
 
virtual bool isDestinationInfo () const
 
virtual bool isFlushCommand () const
 
virtual bool isMessageAck () const
 
virtual bool isMessagePull () const
 
virtual bool isKeepAliveInfo () const
 
virtual bool isMessageDispatch () const
 
virtual bool isMessageDispatchNotification () const
 
virtual bool isProducerAck () const
 
virtual bool isProducerInfo () const
 
virtual bool isResponse () const
 
virtual bool isRemoveInfo () const
 
virtual bool isRemoveSubscriptionInfo () const
 
virtual bool isReplayCommand () const
 
virtual bool isSessionInfo () const
 
virtual bool isShutdownInfo () const
 
virtual bool isTransactionInfo () const
 
virtual bool isWireFormatInfo () const
 
- Public Member Functions inherited from activemq::commands::Command
virtual ~Command ()
 
- Public Member Functions inherited from activemq::commands::BaseDataStructure
virtual ~BaseDataStructure ()
 
virtual void afterMarshal (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
 
virtual void beforeUnmarshal (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
 
virtual void setMarshaledForm (wireformat::WireFormat *wireFormat AMQCPP_UNUSED, const std::vector< char > &data AMQCPP_UNUSED)
 
virtual std::vector< unsigned
char > 
getMarshaledForm (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
 
virtual void copyDataStructure (const DataStructure *src AMQCPP_UNUSED)
 
virtual bool equals (const DataStructure *value AMQCPP_UNUSED) const
 
- Public Member Functions inherited from activemq::commands::DataStructure
virtual ~DataStructure ()
 
- Public Member Functions inherited from activemq::wireformat::MarshalAware
virtual ~MarshalAware ()
 
virtual void beforeMarshal (WireFormat *wireFormat)=0
 Called before marshaling is started to prepare the object to be marshaled. More...
 
virtual void afterMarshal (WireFormat *wireFormat)=0
 Called after marshaling is started to cleanup the object being marshaled. More...
 
virtual void beforeUnmarshal (WireFormat *wireFormat)=0
 Called before unmarshaling is started to prepare the object to be unmarshaled. More...
 
virtual void afterUnmarshal (WireFormat *wireFormat)=0
 Called after unmarshaling is started to cleanup the object being unmarshaled. More...
 
virtual void setMarshaledForm (WireFormat *wireFormat, const std::vector< char > &data)=0
 Called to set the data to this object that will contain the objects marshaled form. More...
 
virtual std::vector< unsigned
char > 
getMarshaledForm (WireFormat *wireFormat)=0
 Called to get the data to this object that will contain the objects marshaled form. More...
 

Static Public Attributes

static const unsigned char ID_ACTIVEMQBYTESMESSAGE
 
- Static Public Attributes inherited from cms::Message
static const int DEFAULT_DELIVERY_MODE
 The Default delivery mode for Message Producers is PERSISTENT. More...
 
static const int DEFAULT_MSG_PRIORITY
 The Default priority assigned to a Message is 4. More...
 
static const long long DEFAULT_TIME_TO_LIVE
 The Default Time to Live for a Message Producer is unlimited, the message will never expire. More...
 
- Static Public Attributes inherited from activemq::commands::Message
static const unsigned char ID_MESSAGE = 0
 

Additional Inherited Members

- Public Types inherited from cms::Message
enum  ValueType {
  NULL_TYPE = 0, BOOLEAN_TYPE = 1, BYTE_TYPE = 2, CHAR_TYPE = 3,
  SHORT_TYPE = 4, INTEGER_TYPE = 5, LONG_TYPE = 6, DOUBLE_TYPE = 7,
  FLOAT_TYPE = 8, STRING_TYPE = 9, BYTE_ARRAY_TYPE = 10, UNKNOWN_TYPE = 11
}
 Defines the Type Identifiers used to identify the type contained within a specific Message property or MapMessage keyed value. More...
 
- Protected Member Functions inherited from activemq::commands::ActiveMQMessageTemplate< cms::BytesMessage >
void failIfWriteOnlyBody () const
 
void failIfReadOnlyBody () const
 
void failIfReadOnlyProperties () const
 
- Protected Attributes inherited from activemq::commands::Message
Pointer< ProducerIdproducerId
 
Pointer< ActiveMQDestinationdestination
 
Pointer< TransactionIdtransactionId
 
Pointer< ActiveMQDestinationoriginalDestination
 
Pointer< MessageIdmessageId
 
Pointer< TransactionIdoriginalTransactionId
 
std::string groupID
 
int groupSequence
 
std::string correlationId
 
bool persistent
 
long long expiration
 
unsigned char priority
 
Pointer< ActiveMQDestinationreplyTo
 
long long timestamp
 
std::string type
 
std::vector< unsigned char > content
 
std::vector< unsigned char > marshalledProperties
 
Pointer< DataStructuredataStructure
 
Pointer< ConsumerIdtargetConsumerId
 
bool compressed
 
int redeliveryCounter
 
std::vector
< decaf::lang::Pointer
< BrokerId > > 
brokerPath
 
long long arrival
 
std::string userID
 
bool recievedByDFBridge
 
bool droppable
 
std::vector
< decaf::lang::Pointer
< BrokerId > > 
cluster
 
long long brokerInTime
 
long long brokerOutTime
 
bool jMSXGroupFirstForConsumer
 
core::ActiveMQConnectionconnection
 
- Static Protected Attributes inherited from activemq::commands::Message
static const unsigned int DEFAULT_MESSAGE_SIZE = 1024
 

Constructor & Destructor Documentation

activemq::commands::ActiveMQBytesMessage::ActiveMQBytesMessage ( )
virtual activemq::commands::ActiveMQBytesMessage::~ActiveMQBytesMessage ( )
throw (
)
virtual

Member Function Documentation

virtual void activemq::commands::ActiveMQBytesMessage::clearBody ( )
virtual

Clears out the body of the message.

This does not clear the headers or properties.

Exceptions
CMSException- if an internal error occurs.

Reimplemented from activemq::commands::ActiveMQMessageTemplate< cms::BytesMessage >.

virtual cms::BytesMessage* activemq::commands::ActiveMQBytesMessage::clone ( ) const
virtual

Clones this message.

Returns
a deep copy of this message.
Exceptions
CMSException- if an internal error occurs while cloning the Message.

Implements cms::BytesMessage.

virtual ActiveMQBytesMessage* activemq::commands::ActiveMQBytesMessage::cloneDataStructure ( ) const
virtual

Clone this obbject and return a new instance that the caller now owns, this will be an exact copy of this one.

Returns
new copy of this object.

Reimplemented from activemq::commands::Message.

virtual void activemq::commands::ActiveMQBytesMessage::copyDataStructure ( const DataStructure src)
virtual

Copy the contents of the passed object into this objects members, overwriting any existing data.

Returns
src - Source Object

Reimplemented from activemq::commands::Message.

virtual bool activemq::commands::ActiveMQBytesMessage::equals ( const DataStructure value) const
virtual

Compares the DataStructure passed in to this one, and returns if they are equivalent.

Equivalent here means that they are of the same type, and that each element of the objects are the same.

Returns
true if DataStructure's are Equal.

Reimplemented from activemq::commands::ActiveMQMessageTemplate< cms::BytesMessage >.

virtual unsigned char* activemq::commands::ActiveMQBytesMessage::getBodyBytes ( ) const
virtual

Gets the bytes that are contained in this message and returns them in a newly allocated array that becomes the property of the caller.

This is a copy of the data contained in this message, changing the value contained in this array has no effect on the data contained in this message.

Returns
pointer to a byte buffer that the call owns upon completion of this method.
Exceptions
CMSException- If an internal error occurs.
MessageNotReadableException- If the message is in Write Only Mode.

Implements cms::BytesMessage.

virtual int activemq::commands::ActiveMQBytesMessage::getBodyLength ( ) const
virtual

Returns the number of bytes contained in the body of this message.

Returns
number of bytes.
Exceptions
CMSException- If an internal error occurs.
MessageNotReadableException- If the message is in Write Only Mode.

Implements cms::BytesMessage.

virtual unsigned char activemq::commands::ActiveMQBytesMessage::getDataStructureType ( ) const
virtual

Get the DataStructure Type as defined in CommandTypes.h.

Returns
The type of the data structure

Reimplemented from activemq::commands::Message.

virtual void activemq::commands::ActiveMQBytesMessage::onSend ( )
virtual

Allows derived Message classes to perform tasks before a message is sent.

Reimplemented from activemq::commands::ActiveMQMessageTemplate< cms::BytesMessage >.

virtual bool activemq::commands::ActiveMQBytesMessage::readBoolean ( ) const
virtual

Reads a Boolean from the Bytes message stream.

Returns
boolean value from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual unsigned char activemq::commands::ActiveMQBytesMessage::readByte ( ) const
virtual

Reads a Byte from the Bytes message stream.

Returns
unsigned char value from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual int activemq::commands::ActiveMQBytesMessage::readBytes ( std::vector< unsigned char > &  value) const
virtual

Reads a byte array from the bytes message stream.

If the length of vector value is less than the number of bytes remaining to be read from the stream, the vector should be filled. A subsequent call reads the next increment, and so on.

If the number of bytes remaining in the stream is less than the length of vector value, the bytes should be read into the vector. The return value of the total number of bytes read will be less than the length of the vector, indicating that there are no more bytes left to be read from the stream. The next read of the stream returns -1.

Parameters
valuebuffer to place data in
Returns
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual int activemq::commands::ActiveMQBytesMessage::readBytes ( unsigned char *  buffer,
int  length 
) const
virtual

Reads a portion of the bytes message stream.

If the length of array value is less than the number of bytes remaining to be read from the stream, the array should be filled. A subsequent call reads the next increment, and so on.

If the number of bytes remaining in the stream is less than the length of array value, the bytes should be read into the array. The return value of the total number of bytes read will be less than the length of the array, indicating that there are no more bytes left to be read from the stream. The next read of the stream returns -1.

If length is negative, or length is greater than the length of the array value, then an IndexOutOfBoundsException is thrown. No bytes will be read from the stream for this exception case.

Parameters
bufferthe buffer into which the data is read
lengththe number of bytes to read; must be less than or equal to value.length
Returns
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual char activemq::commands::ActiveMQBytesMessage::readChar ( ) const
virtual

Reads a Char from the Bytes message stream.

Returns
char value from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual double activemq::commands::ActiveMQBytesMessage::readDouble ( ) const
virtual

Reads a 64 bit double from the Bytes message stream.

Returns
double value from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual float activemq::commands::ActiveMQBytesMessage::readFloat ( ) const
virtual

Reads a 32 bit float from the Bytes message stream.

Returns
double value from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual int activemq::commands::ActiveMQBytesMessage::readInt ( ) const
virtual

Reads a 32 bit signed integer from the Bytes message stream.

Returns
int value from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual long long activemq::commands::ActiveMQBytesMessage::readLong ( ) const
virtual

Reads a 64 bit long from the Bytes message stream.

Returns
long long value from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual short activemq::commands::ActiveMQBytesMessage::readShort ( ) const
virtual

Reads a 16 bit signed short from the Bytes message stream.

Returns
short value from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual std::string activemq::commands::ActiveMQBytesMessage::readString ( ) const
virtual

Reads an ASCII String from the Bytes message stream.

Returns
String from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual unsigned short activemq::commands::ActiveMQBytesMessage::readUnsignedShort ( ) const
virtual

Reads a 16 bit unsigned short from the Bytes message stream.

Returns
unsigned short value from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual std::string activemq::commands::ActiveMQBytesMessage::readUTF ( ) const
virtual

Reads an UTF String from the BytesMessage stream.

Returns
String from stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageEOFException- if unexpected end of bytes stream has been reached.
MessageNotReadableException- if the message is in write-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::reset ( )
virtual

Puts the message body in read-only mode and repositions the stream of bytes to the beginning.

Exceptions
CMSException- If the provider fails to perform the reset operation.
MessageFormatException- If the Message has an invalid format.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::setBodyBytes ( const unsigned char *  buffer,
int  numBytes 
)
virtual

sets the bytes given to the message body.

Parameters
bufferByte Buffer to copy
numBytesNumber of bytes in Buffer to copy
Exceptions
CMSException- If an internal error occurs.
MessageNotWriteableException- if in Read Only Mode.

Implements cms::BytesMessage.

virtual std::string activemq::commands::ActiveMQBytesMessage::toString ( ) const
virtual

Returns a string containing the information for this DataStructure such as its type and value of its elements.

Returns
formatted string useful for debugging.

Reimplemented from activemq::commands::Message.

virtual void activemq::commands::ActiveMQBytesMessage::writeBoolean ( bool  value)
virtual

Writes a boolean to the bytes message stream as a 1-byte value.

The value true is written as the value (byte)1; the value false is written as the value (byte)0.

Parameters
valueboolean to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeByte ( unsigned char  value)
virtual

Writes a byte to the bytes message stream as a 1-byte value.

Parameters
valuebyte to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeBytes ( const std::vector< unsigned char > &  value)
virtual

Writes a byte array to the bytes message stream using the vector size as the number of bytes to write.

Parameters
valuebytes to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeBytes ( const unsigned char *  value,
int  offset,
int  length 
)
virtual

Writes a portion of a byte array to the bytes message stream.

size as the number of bytes to write.

Parameters
valuebytes to write to the stream
offsetthe initial offset within the byte array
lengththe number of bytes to use
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeChar ( char  value)
virtual

Writes a char to the bytes message stream as a 1-byte value.

Parameters
valuechar to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeDouble ( double  value)
virtual

Writes a double to the bytes message stream as a 8 byte value.

Parameters
valuedouble to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeFloat ( float  value)
virtual

Writes a float to the bytes message stream as a 4 byte value.

Parameters
valuefloat to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeInt ( int  value)
virtual

Writes a signed int to the bytes message stream as a 4 byte value.

Parameters
valuesigned int to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeLong ( long long  value)
virtual

Writes a long long to the bytes message stream as a 8 byte value.

Parameters
valuesigned long long to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeShort ( short  value)
virtual

Writes a signed short to the bytes message stream as a 2 byte value.

Parameters
valuesigned short to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeString ( const std::string &  value)
virtual

Writes an ASCII String to the Bytes message stream.

Parameters
valueString to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeUnsignedShort ( unsigned short  value)
virtual

Writes a unsigned short to the bytes message stream as a 2 byte value.

Parameters
valueunsigned short to write to the stream
Exceptions
CMSException- if the CMS provider fails to write the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

virtual void activemq::commands::ActiveMQBytesMessage::writeUTF ( const std::string &  value)
virtual

Writes an UTF String to the BytesMessage stream.

Parameters
valueString to write to the stream
Exceptions
CMSException- if the CMS provider fails to read the message due to some internal error.
MessageNotWriteableException- if the message is in read-only mode.

Implements cms::BytesMessage.

Field Documentation

const unsigned char activemq::commands::ActiveMQBytesMessage::ID_ACTIVEMQBYTESMESSAGE
static

The documentation for this class was generated from the following file: