VMware Tanzu GemFire Native C++ Reference
10.1.5
|
Provide operations for reading primitive data values, byte arrays, strings, Serializable
objects from a byte stream.
More...
Public Member Functions | |
void | advanceCursor (size_t offset) |
advance the cursor by given offset More... | |
const uint8_t * | currentBufferPosition () const |
Get the pointer to current buffer position. More... | |
size_t | getBytesRead () const |
get the number of bytes read in the buffer More... | |
size_t | getBytesRemaining () const |
get the number of bytes remaining to be read in the buffer More... | |
int8_t | read () |
Read a signed byte from the DataInput . More... | |
int32_t | readArrayLength () |
Read a 32-bit signed integer array length value from the DataInput in a manner compatible with java server's DataSerializer.readArrayLength . More... | |
bool | readBoolean () |
Read a boolean value from the DataInput . More... | |
void | readBytes (int8_t **bytes, int32_t *len) |
Read an array of signed bytes from the DataInput expecting to find the length of array in the stream at the start. More... | |
void | readBytes (uint8_t **bytes, int32_t *len) |
Read an array of unsigned bytes from the DataInput expecting to find the length of array in the stream at the start. More... | |
void | readBytesOnly (int8_t *buffer, size_t len) |
Read the given number of signed bytes from the DataInput . More... | |
void | readBytesOnly (uint8_t *buffer, size_t len) |
Read the given number of unsigned bytes from the DataInput . More... | |
double | readDouble () |
Read a double precision number from the DataInput . More... | |
float | readFloat () |
Read a float from the DataInput . More... | |
int16_t | readInt16 () |
Read a 16-bit signed integer from the DataInput . More... | |
int32_t | readInt32 () |
Read a 32-bit signed integer from the DataInput .g. More... | |
int64_t | readInt64 () |
Read a 64-bit signed integer from the DataInput . More... | |
std::shared_ptr< Serializable > | readObject () |
Read a Serializable object from the DataInput. More... | |
void | readObject (std::shared_ptr< Serializable > &ptr) |
Read a Serializable object from the DataInput . More... | |
int64_t | readUnsignedVL () |
Decode a 64 bit integer as a variable length array. More... | |
void | reset () |
reset the cursor to the start of buffer More... | |
void | rewindCursor (size_t offset) |
rewind the cursor by given offset More... | |
Protected Member Functions | |
DataInput (const uint8_t *buffer, size_t len, const CacheImpl *cache, Pool *pool) | |
constructor given a pre-allocated byte array with size More... | |
Provide operations for reading primitive data values, byte arrays, strings, Serializable
objects from a byte stream.
This class is intentionally not thread safe.
|
protected |
constructor given a pre-allocated byte array with size
|
inline |
advance the cursor by given offset
|
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.
|
inline |
get the number of bytes read in the buffer
|
inline |
get the number of bytes remaining to be read in the buffer
|
inline |
Read a signed byte from the DataInput
.
@return signed byte read from stream
|
inline |
Read a 32-bit signed integer array length value from the DataInput
in a manner compatible with java server's DataSerializer.readArrayLength
.
len | output parameter to hold the 32-bit signed length read from stream |
|
inline |
Read a boolean value from the DataInput
.
value | output parameter to hold the boolean read from stream |
|
inline |
Read an array of signed bytes from the DataInput
expecting to find the length of array in the stream at the start.
DataOutput::writeBytes
.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 |
|
inline |
Read an array of unsigned bytes from the DataInput
expecting to find the length of array in the stream at the start.
DataOutput::writeBytes
.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 |
|
inline |
Read the given number of signed bytes from the DataInput
.
DataOutput::writeBytesOnly
and, unlike readBytes
, does not expect the length of array in the stream.buffer | array to hold the bytes read from stream |
len | number of signed bytes to be read |
|
inline |
Read the given number of unsigned bytes from the DataInput
.
DataOutput::writeBytesOnly
and, unlike readBytes
, does not expect the length of array in the stream.buffer | array to hold the bytes read from stream |
len | number of unsigned bytes to be read |
|
inline |
Read a double precision number from the DataInput
.
value | output parameter to hold the double precision number read from stream |
|
inline |
Read a float from the DataInput
.
value | output parameter to hold the float read from stream |
|
inline |
Read a 16-bit signed integer from the DataInput
.
|
inline |
Read a 32-bit signed integer from the DataInput
.g.
value | output parameter to hold the 32-bit signed integer read from stream |
|
inline |
Read a 64-bit signed integer from the DataInput
.
value | output parameter to hold the 64-bit signed integer read from stream |
|
inline |
Read a Serializable object from the DataInput.
nullptr
.
|
inline |
Read a Serializable
object from the DataInput
.
Null objects are handled.
|
inline |
Decode a 64 bit integer as a variable length array.
This is taken from the varint encoding in protobufs (BSD licensed). See https://developers.google.com/protocol-buffers/docs/encoding
|
inline |
reset the cursor to the start of buffer
|
inline |
rewind the cursor by given offset