Method Compact
Compact()
Compacts this byte buffer.
The remaining bytes will be moved to the head of the buffer, starting from position zero. Then the position is set to Remaining; the limit is set to capacity; the mark is cleared.
Declaration
public abstract ByteBuffer Compact()
Returns
Type | Description |
---|---|
ByteBuffer | this buffer. |
Exceptions
Type | Condition |
---|---|
ReadOnlyBufferException | if no changes may be made to the contents of this buffer. |