Provide operations for reading primitive data values, byte arrays, strings, Serializable
objects from a byte stream.
More...
#include <DataInput.hpp>
|
| DataInput (const uint8_t *buffer, size_t len, const CacheImpl *cache, Pool *pool) |
| constructor given a pre-allocated byte array with size
|
|
Provide operations for reading primitive data values, byte arrays, strings, Serializable
objects from a byte stream.
This class is intentionally not thread safe.
◆ DataInput()
apache::geode::client::DataInput::DataInput |
( |
const uint8_t * |
buffer, |
|
|
size_t |
len, |
|
|
const CacheImpl * |
cache, |
|
|
Pool * |
pool |
|
) |
| |
|
protected |
constructor given a pre-allocated byte array with size
◆ advanceCursor()
void apache::geode::client::DataInput::advanceCursor |
( |
size_t |
offset | ) |
|
|
inline |
advance the cursor by given offset
◆ currentBufferPosition()
const uint8_t * apache::geode::client::DataInput::currentBufferPosition |
( |
| ) |
const |
|
inline |
Get the pointer to current buffer position.
This should be treated as readonly and modification of contents using this internal pointer has undefined behavior.
◆ getBytesRead()
size_t apache::geode::client::DataInput::getBytesRead |
( |
| ) |
const |
|
inline |
get the number of bytes read in the buffer
◆ getBytesRemaining()
size_t apache::geode::client::DataInput::getBytesRemaining |
( |
| ) |
const |
|
inline |
get the number of bytes remaining to be read in the buffer
◆ read()
int8_t apache::geode::client::DataInput::read |
( |
| ) |
|
|
inline |
Read a signed byte from the DataInput
.
@return signed byte read from stream
◆ readArrayLength()
int32_t apache::geode::client::DataInput::readArrayLength |
( |
| ) |
|
|
inline |
Read a 32-bit signed integer array length value from the DataInput
in a manner compatible with java server's DataSerializer.readArrayLength
.
◆ readBoolean()
bool apache::geode::client::DataInput::readBoolean |
( |
| ) |
|
|
inline |
◆ readBytes() [1/2]
void apache::geode::client::DataInput::readBytes |
( |
int8_t ** |
bytes, |
|
|
int32_t * |
len |
|
) |
| |
|
inline |
Read an array of signed bytes from the DataInput
expecting to find the length of array in the stream at the start.
- Parameters
-
bytes | output array to hold the bytes read from stream; the array is allocated by this method |
len | output parameter to hold the length of array read from stream |
◆ readBytes() [2/2]
void apache::geode::client::DataInput::readBytes |
( |
uint8_t ** |
bytes, |
|
|
int32_t * |
len |
|
) |
| |
|
inline |
Read an array of unsigned bytes from the DataInput
expecting to find the length of array in the stream at the start.
- Parameters
-
bytes | output array to hold the bytes read from stream; the array is allocated by this method |
len | output parameter to hold the length of array read from stream |
◆ readBytesOnly() [1/2]
void apache::geode::client::DataInput::readBytesOnly |
( |
int8_t * |
buffer, |
|
|
size_t |
len |
|
) |
| |
|
inline |
Read the given number of signed bytes from the DataInput
.
- Parameters
-
buffer | array to hold the bytes read from stream |
len | number of signed bytes to be read |
◆ readBytesOnly() [2/2]
void apache::geode::client::DataInput::readBytesOnly |
( |
uint8_t * |
buffer, |
|
|
size_t |
len |
|
) |
| |
|
inline |
Read the given number of unsigned bytes from the DataInput
.
- Parameters
-
buffer | array to hold the bytes read from stream |
len | number of unsigned bytes to be read |
◆ readDouble()
double apache::geode::client::DataInput::readDouble |
( |
| ) |
|
|
inline |
Read a double precision number from the DataInput
.
◆ readFloat()
float apache::geode::client::DataInput::readFloat |
( |
| ) |
|
|
inline |
◆ readInt16()
int16_t apache::geode::client::DataInput::readInt16 |
( |
| ) |
|
|
inline |
Read a 16-bit signed integer from the DataInput
.
- Returns
- 16-bit signed integer read from stream
◆ readInt32()
int32_t apache::geode::client::DataInput::readInt32 |
( |
| ) |
|
|
inline |
Read a 32-bit signed integer from the DataInput
.g.
◆ readInt64()
int64_t apache::geode::client::DataInput::readInt64 |
( |
| ) |
|
|
inline |
Read a 64-bit signed integer from the DataInput
.
◆ readObject() [1/2]
std::shared_ptr< Serializable > apache::geode::client::DataInput::readObject |
( |
| ) |
|
|
inline |
◆ readObject() [2/2]
void apache::geode::client::DataInput::readObject |
( |
std::shared_ptr< Serializable > & |
ptr | ) |
|
|
inline |
◆ readUnsignedVL()
int64_t apache::geode::client::DataInput::readUnsignedVL |
( |
| ) |
|
|
inline |
◆ reset()
void apache::geode::client::DataInput::reset |
( |
| ) |
|
|
inline |
reset the cursor to the start of buffer
◆ rewindCursor()
void apache::geode::client::DataInput::rewindCursor |
( |
size_t |
offset | ) |
|
|
inline |
rewind the cursor by given offset