implementation.
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public HeapBuffer | asReadOnlyBuffer()
Overrides org. Implements org. Creates a new, read-only |
| protected HeapBuffer | createHeapBuffer(final int offset, final int capacity)
Overrides org. Create a new |
| public boolean | isReadOnly()
Overrides org. Implements org. Tells whether or not this buffer is read-only. |
| public HeapBuffer | prepend(Buffer header)
Overrides org. Implements org. Prepend data from header.position() to header.limit() to the current buffer. |
| public HeapBuffer | put(int index, byte b)
Overrides org. Implements org. Absolute put method (optional operation). |
| public HeapBuffer | put(Buffer src)
Overrides org. Implements org. Relative bulk put method (optional operation). |
| public HeapBuffer | put(Buffer src, int position, int length)
Overrides org. Implements org. Relative bulk put method (optional operation). |
| public Buffer | put(ByteBuffer src)
Overrides org. Implements org. Relative bulk put method (optional operation). |
| public Buffer | put(ByteBuffer src, int position, int length)
Overrides org. Implements org. Relative bulk put method (optional operation). |
| public HeapBuffer | put(byte b)
Overrides org. Implements org. Relative put method (optional operation). |
| public HeapBuffer | put(byte[] src)
Overrides org. Implements org. Relative bulk put method (optional operation). |
| public HeapBuffer | put(byte[] src, int offset, int length)
Overrides org. Implements org. Relative bulk put method (optional operation). |
| public HeapBuffer | putChar(char value)
Overrides org. Implements org. Relative put method for writing a char value (optional operation). |
| public HeapBuffer | putChar(int index, char value)
Overrides org. Implements org. Absolute put method for writing a char value (optional operation). |
| public HeapBuffer | putDouble(double value)
Overrides org. Implements org. Relative put method for writing a double value (optional operation). |
| public HeapBuffer | putDouble(int index, double value)
Overrides org. Implements org. Absolute put method for writing a double value (optional operation). |
| public HeapBuffer | putFloat(float value)
Overrides org. Implements org. Relative put method for writing a float value (optional operation). |
| public HeapBuffer | putFloat(int index, float value)
Overrides org. Implements org. Absolute put method for writing a float value (optional operation). |
| public HeapBuffer | putInt(int value)
Overrides org. Implements org. Relative put method for writing an int value (optional operation). |
| public HeapBuffer | putInt(int index, int value)
Overrides org. Implements org. Absolute put method for writing an int value (optional operation). |
| public HeapBuffer | putLong(long value)
Overrides org. Implements org. Relative put method for writing a long value (optional operation). |
| public HeapBuffer | putLong(int index, long value)
Overrides org. Implements org. Absolute put method for writing a long value (optional operation). |
| public HeapBuffer | putShort(short value)
Overrides org. Implements org. Relative put method for writing a short value (optional operation). |
| public HeapBuffer | putShort(int index, short value)
Overrides org. Implements org. Absolute put method for writing a short value (optional operation). |
| public ByteBuffer | toByteBuffer()
Overrides org. Implements org.
Converts this |
| public ByteBuffer | toByteBuffer(int position, int limit)
Overrides org. Implements org.
Converts this |
| ReadOnlyHeapBuffer | back to summary |
|---|---|
| pack-priv ReadOnlyHeapBuffer(byte[] heap, int offset, int cap) | |
| asReadOnlyBuffer | back to summary |
|---|---|
| public HeapBuffer asReadOnlyBuffer() Overrides org. Implements org. Doc from org. Creates a new, read-only The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer; the new buffer itself, however, will be read-only and will not allow the shared content to be modified. The two buffer's position, limit, and mark values will be independent. The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer.
If this buffer is itself read-only then this method behaves in exactly the same way as the
| |
| createHeapBuffer | back to summary |
|---|---|
| protected HeapBuffer createHeapBuffer(final int offset, final int capacity) Overrides org. Doc from org. Create a new
| |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly() Overrides org. Implements org. Doc from org. Tells whether or not this buffer is read-only.
| |
| prepend | back to summary |
|---|---|
| public HeapBuffer prepend(Buffer header) Overrides org. Implements org. Doc from org. Prepend data from header.position() to header.limit() to the current buffer. This will change the value returned by buffer()!
| |
| put | back to summary |
|---|---|
| public HeapBuffer put(int index, byte b) Overrides org. Implements org. Doc from org. Absolute put method (optional operation). Writes the given byte into this buffer at the given index.
| |
| put | back to summary |
|---|---|
| public HeapBuffer put(Buffer src) Overrides org. Implements org. Doc from org. Relative bulk put method (optional operation).
This method transfers the bytes remaining in the given source buffer into this buffer. If there are more bytes
remaining in the source buffer than in this buffer, that is, if
src.remaining() > remaining(), then no bytes are transferred and a
Otherwise, this method copies n = src.remaining() bytes from the given buffer into this buffer, starting at each buffer's current position. The positions of both buffers are then incremented by n. In other words, an invocation of this method of the form dst.put(src) has exactly the same effect as the loop
while (src.hasRemaining())
dst.put(src.get());
except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.
| |
| put | back to summary |
|---|---|
| public HeapBuffer put(Buffer src, int position, int length) Overrides org. Implements org. Doc from org. Relative bulk put method (optional operation).
This method transfers the "length" bytes from the given source buffer into this buffer. If this buffer has less bytes
remaining than length, that is, if length > remaining(), then no bytes are
transferred and a Otherwise, this method copies n = length bytes from the given position in the source buffer into this buffer, starting from the current buffer position. The positions of this buffer is then incremented by length. In other words, an invocation of this method of the form dst.put(src, position, length) has exactly the same effect as the loop
for (int i = 0; i < length; i++)
dst.put(src.get(i + position));
except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.
| |
| put | back to summary |
|---|---|
| public Buffer put(ByteBuffer src) Overrides org. Implements org. Doc from org. Relative bulk put method (optional operation).
This method transfers the bytes remaining in the given source buffer into this buffer. If there are more bytes
remaining in the source buffer than in this buffer, that is, if
src.remaining() > remaining(), then no bytes are transferred and a
Otherwise, this method copies n = src.remaining() bytes from the given buffer into this buffer, starting at each buffer's current position. The positions of both buffers are then incremented by n. In other words, an invocation of this method of the form dst.put(src) has exactly the same effect as the loop
while (src.hasRemaining())
dst.put(src.get());
except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.
| |
| put | back to summary |
|---|---|
| public Buffer put(ByteBuffer src, int position, int length) Overrides org. Implements org. Doc from org. Relative bulk put method (optional operation).
This method transfers the "length" bytes from the given source buffer into this buffer. If this buffer has less bytes
remaining than length, that is, if length > remaining(), then no bytes are
transferred and a Otherwise, this method copies n = length bytes from the given position in the source buffer into this buffer, starting from the current buffer position. The positions of this buffer is then incremented by length. In other words, an invocation of this method of the form dst.put(src, position, length) has exactly the same effect as the loop
for (int i = 0; i < length; i++)
dst.put(src.get(i + position));
except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.
| |
| put | back to summary |
|---|---|
| public HeapBuffer put(byte b) Overrides org. Implements org. Doc from org. Relative put method (optional operation). Writes the given byte into this buffer at the current position, and then increments the position.
| |
| put | back to summary |
|---|---|
| public HeapBuffer put(byte[] src) Overrides org. Implements org. Doc from org. Relative bulk put method (optional operation). This method transfers the entire content of the given source byte array into this buffer. An invocation of this method of the form dst.put(a) behaves in exactly the same way as the invocation dst.put(a, 0, a.length)
| |
| put | back to summary |
|---|---|
| public HeapBuffer put(byte[] src, int offset, int length) Overrides org. Implements org. Doc from org. Relative bulk put method (optional operation).
This method transfers bytes into this buffer from the given source array. If there are more bytes to be copied from
the array than remain in this buffer, that is, if length > remaining(), then
no bytes are transferred and a Otherwise, this method copies length bytes from the given array into this buffer, starting at the given offset in the array and at the current position of this buffer. The position of this buffer is then incremented by length. In other words, an invocation of this method of the form dst.put(src, off, len) has exactly the same effect as the loop
for (int i = off; i < off + len; i++)
dst.put(a[i]);
except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.
| |
| putChar | back to summary |
|---|---|
| public HeapBuffer putChar(char value) Overrides org. Implements org. Doc from org. Relative put method for writing a char value (optional operation). Writes two bytes containing the given char value, in the current byte order, into this buffer at the current position, and then increments the position by two.
| |
| putChar | back to summary |
|---|---|
| public HeapBuffer putChar(int index, char value) Overrides org. Implements org. Doc from org. Absolute put method for writing a char value (optional operation). Writes two bytes containing the given char value, in the current byte order, into this buffer at the given index.
| |
| putDouble | back to summary |
|---|---|
| public HeapBuffer putDouble(double value) Overrides org. Implements org. Doc from org. Relative put method for writing a double value (optional operation). Writes eight bytes containing the given double value, in the current byte order, into this buffer at the current position, and then increments the position by eight.
| |
| putDouble | back to summary |
|---|---|
| public HeapBuffer putDouble(int index, double value) Overrides org. Implements org. Doc from org. Absolute put method for writing a double value (optional operation). Writes eight bytes containing the given double value, in the current byte order, into this buffer at the given index.
| |
| putFloat | back to summary |
|---|---|
| public HeapBuffer putFloat(float value) Overrides org. Implements org. Doc from org. Relative put method for writing a float value (optional operation). Writes four bytes containing the given float value, in the current byte order, into this buffer at the current position, and then increments the position by four.
| |
| putFloat | back to summary |
|---|---|
| public HeapBuffer putFloat(int index, float value) Overrides org. Implements org. Doc from org. Absolute put method for writing a float value (optional operation). Writes four bytes containing the given float value, in the current byte order, into this buffer at the given index.
| |
| putInt | back to summary |
|---|---|
| public HeapBuffer putInt(int value) Overrides org. Implements org. Doc from org. Relative put method for writing an int value (optional operation). Writes four bytes containing the given int value, in the current byte order, into this buffer at the current position, and then increments the position by four.
| |
| putInt | back to summary |
|---|---|
| public HeapBuffer putInt(int index, int value) Overrides org. Implements org. Doc from org. Absolute put method for writing an int value (optional operation). Writes four bytes containing the given int value, in the current byte order, into this buffer at the given index.
| |
| putLong | back to summary |
|---|---|
| public HeapBuffer putLong(long value) Overrides org. Implements org. Doc from org. Relative put method for writing a long value (optional operation). Writes eight bytes containing the given long value, in the current byte order, into this buffer at the current position, and then increments the position by eight.
| |
| putLong | back to summary |
|---|---|
| public HeapBuffer putLong(int index, long value) Overrides org. Implements org. Doc from org. Absolute put method for writing a long value (optional operation). Writes eight bytes containing the given long value, in the current byte order, into this buffer at the given index.
| |
| putShort | back to summary |
|---|---|
| public HeapBuffer putShort(short value) Overrides org. Implements org. Doc from org. Relative put method for writing a short value (optional operation). Writes two bytes containing the given short value, in the current byte order, into this buffer at the current position, and then increments the position by two.
| |
| putShort | back to summary |
|---|---|
| public HeapBuffer putShort(int index, short value) Overrides org. Implements org. Doc from org. Absolute put method for writing a short value (optional operation). Writes two bytes containing the given short value, in the current byte order, into this buffer at the given index.
| |
| toByteBuffer | back to summary |
|---|---|
| public ByteBuffer toByteBuffer() Overrides org. Implements org. Doc from org.
Converts this
| |
| toByteBuffer | back to summary |
|---|---|
| public ByteBuffer toByteBuffer(int position, int limit) Overrides org. Implements org. Doc from org.
Converts this
| |