FloatBuffer
ported from java.nio.FloatBuffer
A platform-agnostic FloatBuffer built on top of a kotlin‑io Buffer.
The capacity is in numbers of floats (each float is 4 bytes). The position and limit are expressed in floats. When reading/writing, This version tracks an extra baseOffset (in bytes) so that view buffers (via slice()) share the same underlying Buffer while translating float indices appropriately.
All indices (position, limit, capacity) are in units of floats (4 bytes). we convert indices by multiplying by 4.
Properties
Functions
Clears this buffer. Sets position to 0 and limit to capacity.
Compares this buffer to another.
Returns a duplicate FloatBuffer that shares the underlying data buffer reference but has independent position, limit, and mark values. Changes to the underlying data will be visible in both buffers.
Flips this buffer. Sets limit to current position and position to 0.
Relative get method. Reads the float at the current position and then increments the position.
Relative bulk get method.
Absolute get method. Reads the float at the specified index (in floats) without changing the current position. Incorporates the baseOffset for sliced buffers.
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 float at the current position and then increments the position.
Relative bulk put method.
Absolute put method. Writes the given float into the buffer at the specified index (in floats). Incorporates the baseOffset for sliced buffers.
Creates a new FloatBuffer slice that is a view of this buffer's content from the current position to the limit.