|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.client.impl.protocol.util.BufferBuilder
public class BufferBuilder
Builder for appending buffers that grows capacity as necessary.
Field Summary | |
---|---|
static int |
INITIAL_CAPACITY
|
Constructor Summary | |
---|---|
BufferBuilder()
Construct a buffer builder with a default growth increment of INITIAL_CAPACITY |
|
BufferBuilder(int initialCapacity)
Construct a buffer builder with an initial capacity that will be rounded up to the nearest power of 2. |
Method Summary | |
---|---|
BufferBuilder |
append(DirectBuffer srcBuffer,
int srcOffset,
int length)
Append a source buffer to the end of the internal buffer, resizing the internal buffer as required. |
MutableDirectBuffer |
buffer()
The MutableDirectBuffer that encapsulates the internal buffer. |
int |
capacity()
The current capacity of the buffer. |
BufferBuilder |
compact()
Compact the buffer to reclaim unused space above the limit. |
int |
limit()
The current limit of the buffer that has been used by accumulate operations. |
BufferBuilder |
reset()
Reset the builder to restart accumulate operations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int INITIAL_CAPACITY
Constructor Detail |
---|
public BufferBuilder()
INITIAL_CAPACITY
public BufferBuilder(int initialCapacity)
initialCapacity
- at which the capacity will start.Method Detail |
---|
public int capacity()
public int limit()
public MutableDirectBuffer buffer()
MutableDirectBuffer
that encapsulates the internal buffer.
MutableDirectBuffer
that encapsulates the internal buffer.public BufferBuilder reset()
public BufferBuilder compact()
public BufferBuilder append(DirectBuffer 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |