| Modifier and Type | Field and Description |
|---|---|
| private ByteBuffer | buff
The current buffer (may be replaced if it is too small). |
| private static final int | MAX_REUSE_CAPACITY
The maximum size of the buffer in order to be re-used after a clear operation. |
| private static final int | MIN_GROW
The minimum number of bytes to grow a buffer at a time. |
| private ByteBuffer | reuse
The buffer that is used after a clear operation. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public WriteBuffer | |
| private ByteBuffer | |
| public WriteBuffer | |
| public ByteBuffer | |
| private void | |
| public WriteBuffer | |
| public int | |
| public WriteBuffer | |
| public int | |
| public WriteBuffer | |
| public WriteBuffer | |
| public WriteBuffer | Returns: thisthe value bytes, int the source offset offset, int the number of bytes length)Put a byte array. |
| public WriteBuffer | |
| public WriteBuffer | |
| public WriteBuffer | |
| public WriteBuffer | |
| public WriteBuffer | |
| public WriteBuffer | |
| public WriteBuffer | |
| public WriteBuffer | |
| public WriteBuffer | |
| public WriteBuffer | Returns: thisthe string s, int the number of characters to write len)Write the characters of a string in a format similar to UTF-8. |
| public WriteBuffer | |
| public WriteBuffer |
| buff | back to summary |
|---|---|
| private ByteBuffer buff The current buffer (may be replaced if it is too small). | |
| MAX_REUSE_CAPACITY | back to summary |
|---|---|
| private static final int MAX_REUSE_CAPACITY The maximum size of the buffer in order to be re-used after a clear operation. | |
| MIN_GROW | back to summary |
|---|---|
| private static final int MIN_GROW The minimum number of bytes to grow a buffer at a time. | |
| reuse | back to summary |
|---|---|
| private ByteBuffer reuse The buffer that is used after a clear operation. | |
| WriteBuffer | back to summary |
|---|---|
| public WriteBuffer(int initialSize) | |
| WriteBuffer | back to summary |
|---|---|
| public WriteBuffer() | |
| capacity | back to summary |
|---|---|
| public int capacity() Get the capacity.
| |
| clear | back to summary |
|---|---|
| public WriteBuffer clear() Clear the buffer after use.
| |
| ensureCapacity | back to summary |
|---|---|
| private ByteBuffer ensureCapacity(int len) | |
| get | back to summary |
|---|---|
| public WriteBuffer get(byte[] dst) Copy the data into the destination array.
| |
| getBuffer | back to summary |
|---|---|
| public ByteBuffer getBuffer() Get the byte buffer.
| |
| grow | back to summary |
|---|---|
| private void grow(int additional) | |
| limit | back to summary |
|---|---|
| public WriteBuffer limit(int newLimit) Set the limit, possibly growing the buffer.
| |
| limit | back to summary |
|---|---|
| public int limit() Get the limit.
| |
| position | back to summary |
|---|---|
| public WriteBuffer position(int newPosition) Set the position.
| |
| position | back to summary |
|---|---|
| public int position() Get the current position.
| |
| put | back to summary |
|---|---|
| public WriteBuffer put(byte x) Put a byte.
| |
| put | back to summary |
|---|---|
| public WriteBuffer put(byte[] bytes) Put a byte array.
| |
| put | back to summary |
|---|---|
| public WriteBuffer put(byte[] bytes, int offset, int length) Put a byte array.
| |
| put | back to summary |
|---|---|
| public WriteBuffer put(ByteBuffer src) Put the contents of a byte buffer.
| |
| putChar | back to summary |
|---|---|
| public WriteBuffer putChar(char x) Put a character.
| |
| putDouble | back to summary |
|---|---|
| public WriteBuffer putDouble(double x) Put a double.
| |
| putFloat | back to summary |
|---|---|
| public WriteBuffer putFloat(float x) Put a float.
| |
| putInt | back to summary |
|---|---|
| public WriteBuffer putInt(int x) Put an integer.
| |
| putInt | back to summary |
|---|---|
| public WriteBuffer putInt(int index, int value) Update an integer at the given index.
| |
| putLong | back to summary |
|---|---|
| public WriteBuffer putLong(long x) Put a long.
| |
| putShort | back to summary |
|---|---|
| public WriteBuffer putShort(short x) Put a short.
| |
| putShort | back to summary |
|---|---|
| public WriteBuffer putShort(int index, short value) Update a short at the given index.
| |
| putStringData | back to summary |
|---|---|
| public WriteBuffer putStringData(String s, int len) Write the characters of a string in a format similar to UTF-8.
| |
| putVarInt | back to summary |
|---|---|
| public WriteBuffer putVarInt(int x) Write a variable size integer.
| |
| putVarLong | back to summary |
|---|---|
| public WriteBuffer putVarLong(long x) Write a variable size long.
| |