Helper class for reading bytes from buffer without worrying about chunk boundaries. More...
#include <BufferReader.hh>
Public Types | |
typedef detail::data_type | data_type |
typedef detail::size_type | size_type |
Public Member Functions | |
BufferReader (const InputBuffer &buf) | |
BufferReader (const OutputBuffer &buf) | |
size_type | bytesRemaining () const |
How many bytes are still not read from this buffer. | |
size_type | bytesRead () const |
Read a block of data from the front of the buffer. | |
size_type | read (data_type *data, size_type size) |
Read a block of data from the buffer. | |
bool | read (std::string &str, size_type size) |
Read a block of data from the buffer. | |
template<typename T > | |
bool | read (T &val) |
Read a single value from the buffer. | |
bool | skip (size_type bytes) |
Skips a block of data from the buffer. | |
bool | seek (size_type pos) |
Seek to a position in the buffer. | |
bool | peek (char &val) |
InputBuffer | copyData (size_type bytes) |
Helper class for reading bytes from buffer without worrying about chunk boundaries.
May read from an InputBuffer or OutputBuffer.
bool avro::BufferReader::read | ( | T & | val | ) | [inline] |
Read a single value from the buffer.
The value must be a "fundamental" type, e.g. int, float, etc. (otherwise use the other writeTo tests).
References read().