decodeValue method

  1. @override
double decodeValue(
  1. Pipe x,
  2. CType t
)
override

Implementation

@override
double decodeValue(Pipe x, CType t) {
  checkType(t);
  final k = safeRead(x as Pipe<int>, (_bits / 8).ceil());
  if (_bits == 32) {
    return Uint8List.fromList(k)
        .buffer
        .asByteData()
        .getFloat32(0, Endian.little);
  } else {
    return Uint8List.fromList(k)
        .buffer
        .asByteData()
        .getFloat64(0, Endian.little);
  }
}