Buffer implementation, which uses the ByteBuffer underneath.
Buffer, MemoryManager, ByteBuffer
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | |
| protected boolean | |
| protected ByteBuffer | |
| protected int | |
| public static volatile boolean | |
| protected Exception | |
| protected byte[] | |
| protected int | |
| protected int | |
| protected int | |
| protected ByteOrder | |
| protected int | |
| protected boolean |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | |
| public final void | allowBufferDispose(boolean allowBufferDispose)
Implements org.
|
| public byte[] | array()
Implements org. Returns the byte array that backs this buffer (optional operation). |
| public int | arrayOffset()
Implements org. Returns the offset within this buffer's backing array of the first element of the buffer (optional operation). |
| public HeapBuffer | asReadOnlyBuffer()
Implements org. Creates a new, read-only |
| public final int | |
| protected void | |
| public final HeapBuffer | |
| public HeapBuffer | compact()
Implements org. Compacts this buffer (optional operation). |
| public int | compareTo(Buffer o)
Implements java. Compares this object with the specified object for order. |
| protected HeapBuffer | createHeapBuffer(final int
relative offset, the absolute value will calculated as (this.offset + offs) offs, final int capacity)Create a new |
| public void | dispose()
Implements org. Notify the allocator that the space for this Buffer is no longer needed. |
| public void | dumpHex(Appendable appendable)
Implements org. Generate a hex dump of this |
| public HeapBuffer | duplicate()
Implements org. Creates a new |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public final HeapBuffer | |
| public byte | |
| public byte | |
| public HeapBuffer | |
| public HeapBuffer | get(final byte[] dst, final int offset, final int length)
Implements org. Relative bulk get method. |
| public Buffer | |
| public Buffer | get(final ByteBuffer dst, final int position, final int length)
Implements org. Relative bulk get method. |
| public char | getChar()
Implements org. Relative get method for reading a char value. |
| public char | getChar(int index)
Implements org. Absolute get method for reading a char value. |
| public double | getDouble()
Implements org. Relative get method for reading a double value. |
| public double | getDouble(int index)
Implements org. Absolute get method for reading a double value. |
| public float | getFloat()
Implements org. Relative get method for reading a float value. |
| public float | getFloat(int index)
Implements org. Absolute get method for reading a float value. |
| public int | getInt()
Implements org. Relative get method for reading an int value. |
| public int | getInt(int index)
Implements org. Absolute get method for reading an int value. |
| public long | getLong()
Implements org. Relative get method for reading a long value. |
| public long | getLong(int index)
Implements org. Absolute get method for reading a long value. |
| public short | getShort()
Implements org. Relative get method for reading a short value. |
| public short | getShort(int index)
Implements org. Absolute get method for reading a short value. |
| public boolean | hasArray()
Implements org. Tells whether or not this buffer is backed by an accessible byte array. |
| public int | |
| public final boolean | hasRemaining()
Implements org. Tells whether there are any elements between the current position and the limit. |
| public final boolean | |
| public final boolean | isDirect()
Implements org. Tells whether or not this buffer is direct. |
| public boolean | isExternal()
Implements org. Returns true if the message represents an external resource (for example
|
| public boolean | isReadOnly()
Implements org. Tells whether or not this buffer is read-only. |
| public final int | |
| public final HeapBuffer | |
| public final HeapBuffer | |
| protected void | |
| public ByteOrder | |
| public HeapBuffer | order(ByteOrder bo)
Implements org. Modifies this buffer's byte order. |
| public final int | |
| public final HeapBuffer | position(final int newPosition)
Implements org. Sets this buffer's position. |
| protected final void | |
| public HeapBuffer | prepend(final Buffer header)
Implements org. Prepend data from header.position() to header.limit() to the current buffer. |
| public HeapBuffer | |
| public HeapBuffer | put(int index, byte b)
Implements org. Absolute put method (optional operation). |
| public HeapBuffer | put(final Buffer src)
Implements org. Relative bulk put method (optional operation). |
| public HeapBuffer | put(final Buffer src, final int position, final int length)
Implements org. Relative bulk put method (optional operation). |
| public Buffer | put(final ByteBuffer src)
Implements org. Relative bulk put method (optional operation). |
| public Buffer | put(final ByteBuffer src, final int position, final int length)
Implements org. Relative bulk put method (optional operation). |
| public HeapBuffer | put(byte[] src)
Implements org. Relative bulk put method (optional operation). |
| public HeapBuffer | put(byte[] src, int offset, int length)
Implements org. Relative bulk put method (optional operation). |
| public HeapBuffer | put8BitString(final String s)
Implements org. Relative bulk put method (optional operation). |
| public HeapBuffer | putChar(char value)
Implements org. Relative put method for writing a char value (optional operation). |
| public HeapBuffer | putChar(int index, char value)
Implements org. Absolute put method for writing a char value (optional operation). |
| public HeapBuffer | putDouble(double value)
Implements org. Relative put method for writing a double value (optional operation). |
| public HeapBuffer | putDouble(int index, double value)
Implements org. Absolute put method for writing a double value (optional operation). |
| public HeapBuffer | putFloat(float value)
Implements org. Relative put method for writing a float value (optional operation). |
| public HeapBuffer | putFloat(int index, float value)
Implements org. Absolute put method for writing a float value (optional operation). |
| public HeapBuffer | putInt(int value)
Implements org. Relative put method for writing an int value (optional operation). |
| public HeapBuffer | putInt(int index, int value)
Implements org. Absolute put method for writing an int value (optional operation). |
| public HeapBuffer | putLong(long value)
Implements org. Relative put method for writing a long value (optional operation). |
| public HeapBuffer | putLong(int index, long value)
Implements org. Absolute put method for writing a long value (optional operation). |
| public HeapBuffer | putShort(short value)
Implements org. Relative put method for writing a short value (optional operation). |
| public HeapBuffer | putShort(int index, short value)
Implements org. Absolute put method for writing a short value (optional operation). |
| public boolean | release()
Implements org. Perform message specific actions to release resources held by the entity backing this |
| public final int | remaining()
Implements org. Returns the number of elements between the current position and the limit. |
| public final HeapBuffer | reset()
Implements org. Resets this buffer's position to the previously-marked position. |
| public final HeapBuffer | |
| public void | shrink()
Implements org. Disposes the buffer part, outside [position, limit] interval if possible. |
| public HeapBuffer | slice()
Implements org. Creates a new |
| public HeapBuffer | slice(final int position, final int limit)
Implements org. Creates a new |
| public Buffer | split(final int splitPosition)
Implements org. Split up the buffer into two parts: [0..splitPosition) and [splitPosition, capacity). |
| public final BufferArray | toBufferArray()
Implements org.
Returns a new |
| public final BufferArray | toBufferArray(final int position, final int limit)
Implements org.
Updates this |
| public final BufferArray | toBufferArray(final BufferArray array)
Implements org.
Returns the specified |
| public final BufferArray | toBufferArray(final BufferArray array, final int position, final int limit)
Implements org.
Updates this |
| public ByteBuffer | toByteBuffer()
Implements org.
Converts this |
| public ByteBuffer | toByteBuffer(final int position, final int limit)
Implements org.
Converts this |
| protected ByteBuffer | |
| public final ByteBufferArray | toByteBufferArray()
Implements org.
Converts this |
| public final ByteBufferArray | toByteBufferArray(final int position, final int limit)
Implements org.
Converts this |
| public final ByteBufferArray | toByteBufferArray(final ByteBufferArray array)
Implements org.
Converts this |
| public final ByteBufferArray | toByteBufferArray(final ByteBufferArray array, final int position, final int limit)
Implements org.
Converts this |
| public String | |
| public String | |
| public String | |
| public String | toStringContent(Charset charset, final int position, final int limit)
Implements org. |
| public void | trim()
Implements org. Trim the buffer by reducing capacity to position, if possible. |
| public final boolean | tryDispose()
Implements org. Try to dispose Buffer if it's allowed. |
| public ByteBuffer | |
| public static HeapBuffer | |
| public static HeapBuffer |