readMap method Null safety

Map readMap(
  1. int length
)

Reads a Map from the backing buffer

  • length: The number of bytes

Implementation

Map readMap(int length) {
  final res = {};
  while (length > 0) {
    res[read()] = read();
    --length;
  }
  return res;
}