VMware GemFire Native Client C++ API Reference
|
VMware VMware GemFire Native C++ Reference 10.4.3
|
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from a byte stream.
More...
#include <DataInput.hpp>
Public Member Functions | |
| void | advanceCursor (size_t offset) |
| advance the cursor by given offset | |
| const uint8_t * | currentBufferPosition () const |
| Get the pointer to current buffer position. | |
| size_t | getBytesRead () const |
| get the number of bytes read in the buffer | |
| size_t | getBytesRemaining () const |
| get the number of bytes remaining to be read in the buffer | |
| int8_t | read () |
Read a signed byte from the DataInput. | |
| 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. | |
| bool | readBoolean () |
Read a boolean value from the DataInput. | |
| 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. | |
| 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. | |
| void | readBytesOnly (int8_t *buffer, size_t len) |
Read the given number of signed bytes from the DataInput. | |
| void | readBytesOnly (uint8_t *buffer, size_t len) |
Read the given number of unsigned bytes from the DataInput. | |
| double | readDouble () |
Read a double precision number from the DataInput. | |
| float | readFloat () |
Read a float from the DataInput. | |
| int16_t | readInt16 () |
Read a 16-bit signed integer from the DataInput. | |
| int32_t | readInt32 () |
Read a 32-bit signed integer from the DataInput.g. | |
| int64_t | readInt64 () |
Read a 64-bit signed integer from the DataInput. | |
| std::shared_ptr< Serializable > | readObject () |
| Read a Serializable object from the DataInput. | |
| void | readObject (std::shared_ptr< Serializable > &ptr) |
Read a Serializable object from the DataInput. | |
| int64_t | readUnsignedVL () |
| Decode a 64 bit integer as a variable length array. | |
| void | reset () |
| reset the cursor to the start of buffer | |
| void | rewindCursor (size_t offset) |
| rewind the cursor by given offset | |
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 | |
Detailed Description
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from a byte stream.
This class is intentionally not thread safe.
- Remarks
- None of the output parameters in the methods below can be nullptr unless otherwise noted.
Constructor & Destructor Documentation
◆ DataInput()
|
protected |
constructor given a pre-allocated byte array with size
Member Function Documentation
◆ advanceCursor()
|
inline |
advance the cursor by given offset
◆ currentBufferPosition()
|
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()
|
inline |
get the number of bytes read in the buffer
◆ getBytesRemaining()
|
inline |
get the number of bytes remaining to be read in the buffer
◆ read()
|
inline |
Read a signed byte from the DataInput.
@return signed byte read from stream
◆ 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()
|
inline |
Read a boolean value from the DataInput.
◆ readBytes() [1/2]
|
inline |
Read an array of signed bytes from the DataInput expecting to find the length of array in the stream at the start.
- Remarks
- This method is complimentary to
DataOutput::writeBytes.
- 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]
|
inline |
Read an array of unsigned bytes from the DataInput expecting to find the length of array in the stream at the start.
- Remarks
- This method is complimentary to
DataOutput::writeBytes.
- 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]
|
inline |
Read the given number of signed bytes from the DataInput.
- Remarks
- This method is complimentary to
DataOutput::writeBytesOnlyand, unlikereadBytes, does not expect the length of array in the stream.
- Parameters
-
buffer array to hold the bytes read from stream len number of signed bytes to be read
◆ readBytesOnly() [2/2]
|
inline |
Read the given number of unsigned bytes from the DataInput.
- Remarks
- This method is complimentary to
DataOutput::writeBytesOnlyand, unlikereadBytes, does not expect the length of array in the stream.
- Parameters
-
buffer array to hold the bytes read from stream len number of unsigned bytes to be read
◆ readDouble()
|
inline |
Read a double precision number from the DataInput.
◆ readFloat()
|
inline |
Read a float from the DataInput.
◆ readInt16()
|
inline |
Read a 16-bit signed integer from the DataInput.
- Returns
- 16-bit signed integer read from stream
◆ readInt32()
|
inline |
Read a 32-bit signed integer from the DataInput.g.
◆ readInt64()
|
inline |
Read a 64-bit signed integer from the DataInput.
◆ readObject() [1/2]
|
inline |
Read a Serializable object from the DataInput.
- Returns
- Serializable object or
nullptr.
◆ readObject() [2/2]
|
inline |
Read a Serializable object from the DataInput.
Null objects are handled.
◆ readUnsignedVL()
|
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
◆ reset()
|
inline |
reset the cursor to the start of buffer
◆ rewindCursor()
|
inline |
rewind the cursor by given offset
Apache Geode C++ Cache API Documentation