#include <ByteBufferDataReader.h++>


Public Member Functions | |
| ByteBufferDataReader (ByteBuffer &buffer) | |
| Construct a new ByteBufferDataReader for the given ByteBuffer. | |
| ~ByteBufferDataReader () throw () | |
| Destructor. | |
| void | skip (size_t count) throw (IOException) |
| Skip past the given number of bytes in the data stream. | |
| void | reset () throw (IOException) |
| Reset the encoder. | |
| void | setOffset (int64_t offset) throw (IOException) |
| Set the current reading/writing offset. | |
| DataReader & | operator>> (bool &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (byte_t &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (byte_t *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (char &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (char *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (int16_t &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (int16_t *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (uint16_t &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (uint16_t *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (int32_t &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (int32_t *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (uint32_t &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (uint32_t *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (int64_t &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (int64_t *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (uint64_t &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (uint64_t *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (float &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (float *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (double &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (double *v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (Blob &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (String &v) throw (IOException) |
| Read operator. | |
| DataReader & | operator>> (const Manipulator &manip) throw (IOException) |
| Read operator. | |
| void | pushContext () |
| Push a new encoder context. | |
| void | popContext () |
| Pop the active encoder context. | |
| bool | isTopContext () const throw () |
| Determine if the active context is the topmost (and only) context. | |
| uint_t | getContextDepth () const throw () |
| Get the current context depth. | |
| void | setEndianness (Endianness endianness) throw () |
| Specify the byte-endianness for reading/writing primitive integer types in the active context. | |
| Endianness | getEndianness () const throw () |
| Get the byte-endianness in the active context. | |
| void | setLength (size_t length) throw () |
| Specify the length of String, Blob, and array values for subsequent reading/writing in the active context. | |
| size_t | getLength () const throw () |
| Get the current length for string values. | |
| void | setLimit (int64_t limit) throw (IOException) |
| Specify the maximum number of bytes that can be read/written in the active context. | |
| int64_t | getLimit () const throw () |
| Get the current limit. | |
| void | setStringPadding (bool stringPadding) throw () |
| Enables or disable string padding in the active context. | |
| bool | getStringPadding () const throw () |
| Get the current string padding status. | |
| int64_t | getOffset () const throw () |
| Get the current encoding/decoding offset. | |
| int64_t | getCumulativeOffset () const throw () |
| Get the cumulative reading/writing offset. | |
| int64_t | getRemaining () const throw () |
| Get the number of bytes between the current offset and the limit, i.e., the number of bytes remaining to be read or written. | |
| void | align (size_t size) throw (IOException) |
| Skip past enough bytes to re-align the data stream at a specified boundary. | |
Protected Member Functions | |
| size_t | read (byte_t *buf, size_t count) throw (IOException) |
| Read raw data from the input source. | |
| bool | isSameEndianness () const throw () |
| Test if the endianness of the encoder is the same as the endianness of the host system. | |
| Context & | currentContext () |
| Get a reference to the current context. | |
| const Context & | currentContext () const |
| Get a reference to the current context. | |
| void | checkRemaining (const Context &ctx, size_t count) const throw (IOException) |
| Check if at least the given number of bytes are available to be read or written. | |
Protected Attributes | |
| ContextStack * | _contexts |
| int64_t | _maxOffset |
| ByteBufferDataReader | ( | ByteBuffer & | buffer | ) |
| ~ByteBufferDataReader | ( | ) | throw () |
Destructor.
| void align | ( | size_t | size | ) | throw (IOException) [inherited] |
Skip past enough bytes to re-align the data stream at a specified boundary.
When reading, the bytes are simply skipped over; when writing, the bytes are filled with NULs.
| size | The alignment size. Typical values include 2, 4, or 8. Other values are allowed but are of limited usefulness. |
| IOException | If an I/O error occurs. |
| void checkRemaining | ( | const Context & | ctx, | |
| size_t | count | |||
| ) | const throw (IOException) [protected, inherited] |
Check if at least the given number of bytes are available to be read or written.
| ctx | The context to check. | |
| count | The number of bytes. |
| IOException | If there are not enough bytes remaining. |
| const DataEncoder::Context & currentContext | ( | ) | const [protected, inherited] |
Get a reference to the current context.
| DataEncoder::Context & currentContext | ( | ) | [protected, inherited] |
Get a reference to the current context.
| uint_t getContextDepth | ( | ) | const throw () [inherited] |
Get the current context depth.
| int64_t getCumulativeOffset | ( | ) | const throw () [inherited] |
Get the cumulative reading/writing offset.
This is a sum of the offsets across all contexts.
| Endianness getEndianness | ( | ) | const throw () [inherited] |
Get the byte-endianness in the active context.
| size_t getLength | ( | ) | const throw () [inherited] |
Get the current length for string values.
| int64_t getLimit | ( | ) | const throw () [inherited] |
Get the current limit.
| int64_t getOffset | ( | ) | const throw () [inherited] |
Get the current encoding/decoding offset.
| int64_t getRemaining | ( | ) | const throw () [inherited] |
Get the number of bytes between the current offset and the limit, i.e., the number of bytes remaining to be read or written.
| bool getStringPadding | ( | ) | const throw () [inherited] |
Get the current string padding status.
| bool isSameEndianness | ( | ) | const throw () [protected, inherited] |
Test if the endianness of the encoder is the same as the endianness of the host system.
| bool isTopContext | ( | ) | const throw () [inherited] |
Determine if the active context is the topmost (and only) context.
| DataReader & operator>> | ( | const Manipulator & | manip | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | String & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | Blob & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | double * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | double & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | float * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | float & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | uint64_t * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | uint64_t & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | int64_t * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | int64_t & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | uint32_t * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | uint32_t & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | int32_t * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | int32_t & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | uint16_t * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | uint16_t & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | int16_t * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | int16_t & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | char * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | char & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | byte_t * | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | byte_t & | v | ) | throw (IOException) [inherited] |
Read operator.
| DataReader & operator>> | ( | bool & | v | ) | throw (IOException) [inherited] |
Read operator.
| void popContext | ( | ) | [inherited] |
Pop the active encoder context.
The previous context becomes the active context, and the offset in the current context is incremented by the offset of the popped context.
| void pushContext | ( | ) | [inherited] |
Push a new encoder context.
| size_t read | ( | byte_t * | buf, | |
| size_t | count | |||
| ) | throw (IOException) [protected, virtual] |
| void reset | ( | ) | throw (IOException) [virtual] |
Reset the encoder.
Discards all but the topmost context, and resets the topmost context to default values.
Reimplemented from DataEncoder.
| void setEndianness | ( | Endianness | endianness | ) | throw () [inherited] |
Specify the byte-endianness for reading/writing primitive integer types in the active context.
| void setLength | ( | size_t | length | ) | throw () [inherited] |
Specify the length of String, Blob, and array values for subsequent reading/writing in the active context.
Depending on whether string padding is enabled or disabled, written strings will be padded with either space characters or NUL bytes, respectively.
| void setLimit | ( | int64_t | limit | ) | throw (IOException) [inherited] |
Specify the maximum number of bytes that can be read/written in the active context.
Attempts to read/write past this limit will raise an IOException.
| void setOffset | ( | int64_t | offset | ) | throw (IOException) [virtual] |
| void setStringPadding | ( | bool | stringPadding | ) | throw () [inherited] |
Enables or disable string padding in the active context.
When enabled, strings are padded with spaces during writing; otherwise they are padded with NUL bytes.
| stringPadding | A flag indicating the type of padding; true for spaces, false for NUL bytes. |
| void skip | ( | size_t | count | ) | throw (IOException) [virtual] |
Skip past the given number of bytes in the data stream.
When reading, the bytes are simply skipped over; when writing, the bytes are filled with NULs.
| count | The number of bytes to skip. |
| IOException | If an I/O error occurs. |
Implements DataEncoder.
ContextStack* _contexts [protected, inherited] |
int64_t _maxOffset [protected, inherited] |
1.5.9