ByteBuffer.
This class is not thread safe.
| Modifier and Type | Class and Description |
|---|---|
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| private ByteBuffer | |
| private ExpandableBuffer. |
| Access | Constructor and Description |
|---|---|
| protected | ExpandableBuffer(final int
the buffer size. bufferSize)Allocates buffer of the given size using the given allocator. |
| Modifier and Type | Method and Description |
|---|---|
| protected ByteBuffer | |
| protected int | |
| protected void | |
| protected void | ensureAdjustedCapacity(final int
the required capacity. requiredCapacity)Ensures the buffer can accommodate at least the required capacity adjusted to multiples of 1024. |
| protected void | ensureCapacity(final int
the required capacity. requiredCapacity)Ensures the buffer can accommodate the exact required capacity. |
| protected void | |
| private void | |
| protected boolean | Returns: true if there is data in the buffer,
false otherwise.Determines if the buffer contains data. |
| protected int | |
| protected ExpandableBuffer. | Returns: current input/output mode.Returns the current mode:
|
| protected void | |
| protected void | |
| public String |
| buffer | back to summary |
|---|---|
| private ByteBuffer buffer | |
| mode | back to summary |
|---|---|
| private ExpandableBuffer. | |
| ExpandableBuffer | back to summary |
|---|---|
| protected ExpandableBuffer(final int bufferSize) Allocates buffer of the given size using the given allocator. Sets the mode to input.
| |
| buffer | back to summary |
|---|---|
| protected ByteBuffer buffer() | |
| capacity | back to summary |
|---|---|
| protected int capacity() Returns available capacity of this buffer.
| |
| clear | back to summary |
|---|---|
| protected void clear() Clears buffer. Sets the mode to input. | |
| ensureAdjustedCapacity | back to summary |
|---|---|
| protected void ensureAdjustedCapacity(final int requiredCapacity) Ensures the buffer can accommodate at least the required capacity adjusted to multiples of 1024.
| |
| ensureCapacity | back to summary |
|---|---|
| protected void ensureCapacity(final int requiredCapacity) Ensures the buffer can accommodate the exact required capacity.
| |
| expand | back to summary |
|---|---|
| protected void expand() throws BufferOverflowException Expands buffer's capacity.
| |
| expandCapacity | back to summary |
|---|---|
| private void expandCapacity(final int capacity) | |
| hasData | back to summary |
|---|---|
| protected boolean hasData() Determines if the buffer contains data. Sets the mode to output.
| |
| length | back to summary |
|---|---|
| protected int length() Returns the length of this buffer. Sets the mode to output.
| |
| mode | back to summary |
|---|---|
| protected ExpandableBuffer. Returns the current mode:
| |
| setInputMode | back to summary |
|---|---|
| protected void setInputMode() Sets the mode to input. The buffer can now be written into. | |
| setOutputMode | back to summary |
|---|---|
| protected void setOutputMode() Sets the mode to output. The buffer can now be read from. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final ExpandableBuffer. | |
| public static final ExpandableBuffer. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ExpandableBuffer. | |
| public static ExpandableBuffer. |
| INPUT | back to summary |
|---|---|
| public static final ExpandableBuffer. | |
| OUTPUT | back to summary |
|---|---|
| public static final ExpandableBuffer. | |
| Mode | back to summary |
|---|---|
| private Mode() | |
| valueOf | back to summary |
|---|---|
| public static ExpandableBuffer. | |
| values | back to summary |
|---|---|
| public static ExpandableBuffer. | |