LongBuffer
A platform-agnostic LongBuffer built on top of a kotlin‑io Buffer.
The capacity is in numbers of longs (each long is 8 bytes). The position and limit are expressed in longs. When reading/writing, This version tracks an extra baseOffset (in bytes) so that view buffers (via slice()) share the same underlying Buffer while translating long indices appropriately.
All indices (position, limit, capacity) are in units of longs (8 bytes). we convert indices by multiplying by 8.
Properties
Functions
Clears this buffer. Sets position to 0 and limit to capacity.
Returns a duplicate LongBuffer that shares the underlying data. The duplicate’s position, limit, and byte order are set to the same values.
Flips this buffer. Sets limit to current position and position to 0.
Relative get method. Reads the long at the current position and then increments the position.
Absolute get method. Reads the long at the specified index (in longs) without changing the current position.
Relative bulk get method.
Returns whether there are any elements remaining between position and limit.
Sets this buffer's limit. If the position is larger than the new limit then it is set to the new limit. If the mark is defined and larger than the new limit then it is discarded.
Sets this buffer's position. If the mark is defined and larger than the new position then it is discarded.
Relative put method. Writes the given long at the current position and then increments the position.
Absolute put method. Writes the given long into the buffer at the specified index (in longs).
Creates a new LongBuffer slice that is a view of this buffer's content from the current position to the limit.