Phants Client for Redis™*
|
Public Member Functions | |
BufferDescriptor (int bufferLen) | |
BufferDescriptor (byte[] userBuffer) | |
int | NumUnreadBytes () |
void | ResetIndices () |
Public Attributes | |
byte[] | data |
int | readIndex |
int | writeIndex |
Basically just a dumb struct for storing buffer state, but defined as a class so we can pass around references to it.
This is an internal class used to track network buffers, it currently serves no purpose in user code, but is public nonetheless.
|
inline |
Constructs a BufferDescriptor.
The buffer will be allocated internally with the given size.
bufferLen | Size of the buffer to allocate. |
|
inline |
Constructs a BufferDescriptor.
The user provided buffer will serve as the internal buffer.
userBuffer | A user provided buffer. |
|
inline |
Returns the number of unread bytes sitting in the buffer.
|
inline |
Discards the current buffer state by resetting the read/write indices.
byte [] data |
The backing buffer.
int readIndex |
Zero-based index into data pointing to unread data.
int writeIndex |
Zero-based index into data pointing to unwritten space.