activemq-cpp-3.6.0
|
Manages the writing and reading of boolean data streams to and from a data source such as a DataInputStream or DataOutputStream. More...
#include <src/main/activemq/wireformat/openwire/utils/BooleanStream.h>
Public Member Functions | |
BooleanStream () | |
virtual | ~BooleanStream () |
bool | readBoolean () |
Read a boolean data element from the internal data buffer. | |
void | writeBoolean (bool value) |
Writes a Boolean value to the internal data buffer. | |
void | marshal (decaf::io::DataOutputStream *dataOut) |
Marshal the data to a DataOutputStream. | |
void | marshal (std::vector< unsigned char > &dataOut) |
Marshal the data to a STL vector of unsigned chars. | |
void | unmarshal (decaf::io::DataInputStream *dataIn) |
Unmarshal a Boolean data stream from the Input Stream. | |
void | clear () |
Clears to old position markers, data starts at the beginning. | |
int | marshalledSize () |
Calc the size that data is marshalled to. |
Manages the writing and reading of boolean data streams to and from a data source such as a DataInputStream or DataOutputStream.
The booleans are stored as single bits in the stream, with the stream size pre-pended to the stream when the data is marshalled.
The serialized form of the size field can be between 1 and 3 bytes. If the number of used bytes < 64, size=1 byte If the number of used bytes >=64 and < 256 (size of an unsigned byte), size=2 bytes If the number of used bytes >=256, size=3 bytes
The high-order 2 bits (128 and 64) of the first byte of the size field are used to encode the information about the number of bytes in the size field. The only time the first byte will contain a value >=64 is if there are more bytes in the size field. If the first byte < 64, the value of the byte is simply the size value. If the first byte = 0xC0, the following unsigned byte is the size field. If the first byte = 0x80, the following short (two bytes) are the size field.
activemq::wireformat::openwire::utils::BooleanStream::BooleanStream | ( | ) |
|
virtual |
void activemq::wireformat::openwire::utils::BooleanStream::clear | ( | ) |
Clears to old position markers, data starts at the beginning.
void activemq::wireformat::openwire::utils::BooleanStream::marshal | ( | decaf::io::DataOutputStream * | dataOut | ) |
Marshal the data to a DataOutputStream.
dataOut | - Stream to write the data to. |
IOException | if an I/O error occurs during this operation. |
void activemq::wireformat::openwire::utils::BooleanStream::marshal | ( | std::vector< unsigned char > & | dataOut | ) |
Marshal the data to a STL vector of unsigned chars.
dataOut | - reference to a vector to write the data to. |
IOException | if an I/O error occurs during this operation. |
int activemq::wireformat::openwire::utils::BooleanStream::marshalledSize | ( | ) |
Calc the size that data is marshalled to.
bool activemq::wireformat::openwire::utils::BooleanStream::readBoolean | ( | ) |
Read a boolean data element from the internal data buffer.
IOException | if an I/O error occurs during this operation. |
Referenced by activemq::wireformat::openwire::marshal::BaseDataStreamMarshaller::tightMarshalObjectArray2().
void activemq::wireformat::openwire::utils::BooleanStream::unmarshal | ( | decaf::io::DataInputStream * | dataIn | ) |
Unmarshal a Boolean data stream from the Input Stream.
dataIn | - Input Stream to read data from. |
IOException | if an I/O error occurs during this operation. |
void activemq::wireformat::openwire::utils::BooleanStream::writeBoolean | ( | bool | value | ) |
Writes a Boolean value to the internal data buffer.
value | - boolean data to write. |
IOException | if an I/O error occurs during this operation. |
Referenced by activemq::wireformat::openwire::marshal::BaseDataStreamMarshaller::tightMarshalObjectArray1().