#include <src/main/cms/BytesMessage.h>
Public Member Functions | |
virtual | ~BytesMessage () |
virtual void | setBodyBytes (const unsigned char *buffer, std::size_t numBytes)=0 throw ( CMSException ) |
sets the bytes given to the message body. | |
virtual const unsigned char * | getBodyBytes () const =0 |
Gets the bytes that are contained in this message, user should copy this data into a user allocated buffer. | |
virtual std::size_t | getBodyLength () const =0 |
Returns the number of bytes contained in the body of this message. | |
virtual void | reset ()=0 throw ( cms::CMSException ) |
Puts the message body in read-only mode and repositions the stream of bytes to the beginning. | |
virtual bool | readBoolean () const =0 throw ( cms::CMSException ) |
Reads a Boolean from the Bytes message stream. | |
virtual void | writeBoolean (bool value)=0 throw ( cms::CMSException ) |
Writes a boolean to the bytes message stream as a 1-byte value. | |
virtual unsigned char | readByte () const =0 throw ( cms::CMSException ) |
Reads a Byte from the Bytes message stream. | |
virtual void | writeByte (unsigned char value)=0 throw ( cms::CMSException ) |
Writes a byte to the bytes message stream as a 1-byte value. | |
virtual std::size_t | readBytes (std::vector< unsigned char > &value) const =0 throw ( cms::CMSException ) |
Reads a byte array from the bytes message stream. | |
virtual void | writeBytes (const std::vector< unsigned char > &value)=0 throw ( cms::CMSException ) |
Writes a byte array to the bytes message stream using the vector size as the number of bytes to write. | |
virtual std::size_t | readBytes (unsigned char *&buffer, std::size_t length) const =0 throw ( cms::CMSException ) |
Reads a portion of the bytes message stream. | |
virtual void | writeBytes (const unsigned char *value, std::size_t offset, std::size_t length)=0 throw ( cms::CMSException ) |
Writes a portion of a byte array to the bytes message stream. | |
virtual char | readChar () const =0 throw ( cms::CMSException ) |
Reads a Char from the Bytes message stream. | |
virtual void | writeChar (char value)=0 throw ( cms::CMSException ) |
Writes a char to the bytes message stream as a 1-byte value. | |
virtual float | readFloat () const =0 throw ( cms::CMSException ) |
Reads a 32 bit float from the Bytes message stream. | |
virtual void | writeFloat (float value)=0 throw ( cms::CMSException ) |
Writes a float to the bytes message stream as a 4 byte value. | |
virtual double | readDouble () const =0 throw ( cms::CMSException ) |
Reads a 64 bit double from the Bytes message stream. | |
virtual void | writeDouble (double value)=0 throw ( cms::CMSException ) |
Writes a double to the bytes message stream as a 8 byte value. | |
virtual short | readShort () const =0 throw ( cms::CMSException ) |
Reads a 16 bit signed short from the Bytes message stream. | |
virtual void | writeShort (short value)=0 throw ( cms::CMSException ) |
Writes a signed short to the bytes message stream as a 2 byte value. | |
virtual unsigned short | readUnsignedShort () const =0 throw ( cms::CMSException ) |
Reads a 16 bit unsigned short from the Bytes message stream. | |
virtual void | writeUnsignedShort (unsigned short value)=0 throw ( cms::CMSException ) |
Writes a unsigned short to the bytes message stream as a 2 byte value. | |
virtual int | readInt () const =0 throw ( cms::CMSException ) |
Reads a 32 bit signed intger from the Bytes message stream. | |
virtual void | writeInt (int value)=0 throw ( cms::CMSException ) |
Writes a signed int to the bytes message stream as a 4 byte value. | |
virtual long long | readLong () const =0 throw ( cms::CMSException ) |
Reads a 64 bit long from the Bytes message stream. | |
virtual void | writeLong (long long value)=0 throw ( cms::CMSException ) |
Writes a long long to the bytes message stream as a 8 byte value. | |
virtual std::string | readString () const =0 throw ( cms::CMSException ) |
Reads an ASCII String from the Bytes message stream. | |
virtual void | writeString (const std::string &value)=0 throw ( cms::CMSException ) |
Writes an ASCII String to the Bytes message stream. | |
virtual std::string | readUTF () const =0 throw ( cms::CMSException ) |
Reads an UTF String from the BytesMessage stream. | |
virtual void | writeUTF (const std::string &value)=0 throw ( cms::CMSException ) |
Writes an UTF String to the BytesMessage stream. | |
virtual BytesMessage * | clone () const =0 |
Clones this message. |
virtual cms::BytesMessage::~BytesMessage | ( | ) | [inline, virtual] |
virtual void cms::BytesMessage::setBodyBytes | ( | const unsigned char * | buffer, | |
std::size_t | numBytes | |||
) | throw ( CMSException ) [pure virtual] |
sets the bytes given to the message body.
buffer | Byte Buffer to copy | |
numBytes | Number of bytes in Buffer to copy |
CMSException |
virtual const unsigned char* cms::BytesMessage::getBodyBytes | ( | ) | const [pure virtual] |
Gets the bytes that are contained in this message, user should copy this data into a user allocated buffer.
Call getBodyLength
to determine the number of bytes to expect.
virtual std::size_t cms::BytesMessage::getBodyLength | ( | ) | const [pure virtual] |
Returns the number of bytes contained in the body of this message.
virtual void cms::BytesMessage::reset | ( | ) | throw ( cms::CMSException ) [pure virtual] |
Puts the message body in read-only mode and repositions the stream of bytes to the beginning.
CMSException |
virtual bool cms::BytesMessage::readBoolean | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads a Boolean from the Bytes message stream.
CMSException |
virtual void cms::BytesMessage::writeBoolean | ( | bool | value | ) | throw ( cms::CMSException ) [pure 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.
value | boolean to write to the stream |
CMSException |
virtual unsigned char cms::BytesMessage::readByte | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads a Byte from the Bytes message stream.
CMSException |
virtual void cms::BytesMessage::writeByte | ( | unsigned char | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes a byte to the bytes message stream as a 1-byte value.
value | byte to write to the stream |
CMSException |
virtual std::size_t cms::BytesMessage::readBytes | ( | std::vector< unsigned char > & | value | ) | const throw ( cms::CMSException ) [pure 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.
value | buffer to place data in |
CMSException | if an error occurs. |
virtual void cms::BytesMessage::writeBytes | ( | const std::vector< unsigned char > & | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes a byte array to the bytes message stream using the vector size as the number of bytes to write.
value | bytes to write to the stream |
CMSException |
virtual std::size_t cms::BytesMessage::readBytes | ( | unsigned char *& | buffer, | |
std::size_t | length | |||
) | const throw ( cms::CMSException ) [pure 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.
buffer | the buffer into which the data is read | |
length | the number of bytes to read; must be less than or equal to value.length |
CMSException |
virtual void cms::BytesMessage::writeBytes | ( | const unsigned char * | value, | |
std::size_t | offset, | |||
std::size_t | length | |||
) | throw ( cms::CMSException ) [pure virtual] |
Writes a portion of a byte array to the bytes message stream.
size as the number of bytes to write.
value | bytes to write to the stream | |
offset | the initial offset within the byte array | |
length | the number of bytes to use |
CMSException |
virtual char cms::BytesMessage::readChar | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
virtual void cms::BytesMessage::writeChar | ( | char | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes a char to the bytes message stream as a 1-byte value.
value | char to write to the stream |
CMSException |
virtual float cms::BytesMessage::readFloat | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads a 32 bit float from the Bytes message stream.
CMSException |
virtual void cms::BytesMessage::writeFloat | ( | float | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes a float to the bytes message stream as a 4 byte value.
value | float to write to the stream |
CMSException |
virtual double cms::BytesMessage::readDouble | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads a 64 bit double from the Bytes message stream.
CMSException |
virtual void cms::BytesMessage::writeDouble | ( | double | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes a double to the bytes message stream as a 8 byte value.
value | double to write to the stream |
CMSException |
virtual short cms::BytesMessage::readShort | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads a 16 bit signed short from the Bytes message stream.
CMSException |
virtual void cms::BytesMessage::writeShort | ( | short | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes a signed short to the bytes message stream as a 2 byte value.
value | signed short to write to the stream |
CMSException |
virtual unsigned short cms::BytesMessage::readUnsignedShort | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads a 16 bit unsigned short from the Bytes message stream.
CMSException |
virtual void cms::BytesMessage::writeUnsignedShort | ( | unsigned short | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes a unsigned short to the bytes message stream as a 2 byte value.
value | unsigned short to write to the stream |
CMSException |
virtual int cms::BytesMessage::readInt | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads a 32 bit signed intger from the Bytes message stream.
CMSException |
virtual void cms::BytesMessage::writeInt | ( | int | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes a signed int to the bytes message stream as a 4 byte value.
value | signed int to write to the stream |
CMSException |
virtual long long cms::BytesMessage::readLong | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads a 64 bit long from the Bytes message stream.
CMSException |
virtual void cms::BytesMessage::writeLong | ( | long long | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes a long long to the bytes message stream as a 8 byte value.
value | signed long long to write to the stream |
CMSException |
virtual std::string cms::BytesMessage::readString | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads an ASCII String from the Bytes message stream.
CMSException |
virtual void cms::BytesMessage::writeString | ( | const std::string & | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes an ASCII String to the Bytes message stream.
value | String to write to the stream |
CMSException |
virtual std::string cms::BytesMessage::readUTF | ( | ) | const throw ( cms::CMSException ) [pure virtual] |
Reads an UTF String from the BytesMessage stream.
CMSException |
virtual void cms::BytesMessage::writeUTF | ( | const std::string & | value | ) | throw ( cms::CMSException ) [pure virtual] |
Writes an UTF String to the BytesMessage stream.
value | String to write to the stream |
CMSException |
virtual BytesMessage* cms::BytesMessage::clone | ( | ) | const [pure virtual] |