cms::BytesMessage Class Reference

#include <src/main/cms/BytesMessage.h>

Inheritance diagram for cms::BytesMessage:

Inheritance graph
[legend]
Collaboration diagram for cms::BytesMessage:

Collaboration graph
[legend]

Detailed Description

A message used for sending a stream of uninterpreted bytes.

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 BytesMessageclone () const =0
 Clones this message.

Constructor & Destructor Documentation

virtual cms::BytesMessage::~BytesMessage (  )  [inline, virtual]


Member Function Documentation

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.

Parameters:
buffer Byte Buffer to copy
numBytes Number of bytes in Buffer to copy
Exceptions:
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.

Returns:
const pointer to a byte buffer

virtual std::size_t cms::BytesMessage::getBodyLength (  )  const [pure virtual]

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

Returns:
number of bytes.

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.

Exceptions:
CMSException 

virtual bool cms::BytesMessage::readBoolean (  )  const throw ( cms::CMSException ) [pure virtual]

Reads a Boolean from the Bytes message stream.

Returns:
boolean value from stream
Exceptions:
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.

Parameters:
value boolean to write to the stream
Exceptions:
CMSException 

virtual unsigned char cms::BytesMessage::readByte (  )  const throw ( cms::CMSException ) [pure virtual]

Reads a Byte from the Bytes message stream.

Returns:
unsigned char value from stream
Exceptions:
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.

Parameters:
value byte to write to the stream
Exceptions:
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.

Parameters:
value buffer 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 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.

Parameters:
value bytes to write to the stream
Exceptions:
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.

Parameters:
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
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 

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.

Parameters:
value bytes to write to the stream
offset the initial offset within the byte array
length the number of bytes to use
Exceptions:
CMSException 

virtual char cms::BytesMessage::readChar (  )  const throw ( cms::CMSException ) [pure virtual]

Reads a Char from the Bytes message stream.

Returns:
char value from stream
Exceptions:
CMSException 

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.

Parameters:
value char to write to the stream
Exceptions:
CMSException 

virtual float cms::BytesMessage::readFloat (  )  const throw ( cms::CMSException ) [pure virtual]

Reads a 32 bit float from the Bytes message stream.

Returns:
double value from stream
Exceptions:
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.

Parameters:
value float to write to the stream
Exceptions:
CMSException 

virtual double cms::BytesMessage::readDouble (  )  const throw ( cms::CMSException ) [pure virtual]

Reads a 64 bit double from the Bytes message stream.

Returns:
double value from stream
Exceptions:
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.

Parameters:
value double to write to the stream
Exceptions:
CMSException 

virtual short cms::BytesMessage::readShort (  )  const throw ( cms::CMSException ) [pure virtual]

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

Returns:
short value from stream
Exceptions:
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.

Parameters:
value signed short to write to the stream
Exceptions:
CMSException 

virtual unsigned short cms::BytesMessage::readUnsignedShort (  )  const throw ( cms::CMSException ) [pure virtual]

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

Returns:
unsigned short value from stream
Exceptions:
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.

Parameters:
value unsigned short to write to the stream
Exceptions:
CMSException 

virtual int cms::BytesMessage::readInt (  )  const throw ( cms::CMSException ) [pure virtual]

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

Returns:
int value from stream
Exceptions:
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.

Parameters:
value signed int to write to the stream
Exceptions:
CMSException 

virtual long long cms::BytesMessage::readLong (  )  const throw ( cms::CMSException ) [pure virtual]

Reads a 64 bit long from the Bytes message stream.

Returns:
long long value from stream
Exceptions:
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.

Parameters:
value signed long long to write to the stream
Exceptions:
CMSException 

virtual std::string cms::BytesMessage::readString (  )  const throw ( cms::CMSException ) [pure virtual]

Reads an ASCII String from the Bytes message stream.

Returns:
String from stream
Exceptions:
CMSException 

virtual void cms::BytesMessage::writeString ( const std::string &  value  )  throw ( cms::CMSException ) [pure virtual]

Writes an ASCII String to the Bytes message stream.

Parameters:
value String to write to the stream
Exceptions:
CMSException 

virtual std::string cms::BytesMessage::readUTF (  )  const throw ( cms::CMSException ) [pure virtual]

Reads an UTF String from the BytesMessage stream.

Returns:
String from stream
Exceptions:
CMSException 

virtual void cms::BytesMessage::writeUTF ( const std::string &  value  )  throw ( cms::CMSException ) [pure virtual]

Writes an UTF String to the BytesMessage stream.

Parameters:
value String to write to the stream
Exceptions:
CMSException 

virtual BytesMessage* cms::BytesMessage::clone (  )  const [pure virtual]

Clones this message.

Returns:
a deep copy of this message.

Implements cms::Message.


The documentation for this class was generated from the following file:
Generated on Sat Oct 27 16:56:59 2007 for cms-1.2 by  doxygen 1.5.3