appendFloat4 method

void appendFloat4(
  1. double value
)

Converts four bytes from the read buffer to a float.

The byte order is big-endian.

@return the float value.

Implementation

void appendFloat4(double value) {
  // https://stackoverflow.com/questions/55355482/parsing-integer-bit-patterns-as-ieee-754-floats-in-dart
  // var bdata = ByteData(4);
  // bdata.setInt32(0, readInt());
  // return bdata.getFloat32(0);

  var bdata = ByteData(4);
  bdata.setFloat32(0, value);
  int result = bdata.getInt32(0);
  appendInt4(result);
}