setFloat32 method

void setFloat32(
  1. double value,
  2. int offset, [
  3. Endian endian = Endian.little
])

Writes a floating point value to 4-bytes.

The offset must satisy the relations 0offsetoffset+4this.length.

final Buffer buffer = Buffer(4);
buffer.setFloat32(2.1426990032196045, 0);
print(buffer); // [251, 33, 9, 64]

Implementation

void setFloat32(final double value, final int offset,
    [final Endian endian = Endian.little]) {
  return asByteData().setFloat32(offset, value, endian);
}