public class BufferBuilder extends Object
Modifier and Type | Field and Description |
---|---|
static int |
INITIAL_CAPACITY
Buffer's default initial capacity
|
Constructor and Description |
---|
BufferBuilder()
Construct a buffer builder with a default growth increment of
INITIAL_CAPACITY |
Modifier and Type | Method and Description |
---|---|
BufferBuilder |
append(ClientProtocolBuffer srcBuffer,
int srcOffset,
int length)
Append a source buffer to the end of the internal buffer, resizing the internal buffer as required.
|
ClientProtocolBuffer |
buffer()
The
ClientProtocolBuffer that encapsulates the internal buffer. |
int |
capacity()
The current capacity of the buffer.
|
static ClientProtocolBuffer |
createBuffer(byte[] byteArray)
Creates ClientProtocolBuffer safe/unsafe according to property with existing byteArray
|
int |
position()
The current position of the buffer that has been used by accumulate operations.
|
public static final int INITIAL_CAPACITY
public BufferBuilder()
INITIAL_CAPACITY
public int capacity()
public int position()
public ClientProtocolBuffer buffer()
ClientProtocolBuffer
that encapsulates the internal buffer.ClientProtocolBuffer
that encapsulates the internal buffer.public BufferBuilder append(ClientProtocolBuffer srcBuffer, int srcOffset, int length)
srcBuffer
- from which to copy.srcOffset
- in the source buffer from which to copy.length
- in bytes to copy from the source buffer.public static ClientProtocolBuffer createBuffer(byte[] byteArray)
byteArray
- existing byteArrayCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.