readRiftList method

  1. @override
RiftList<RiftObjectMixin> readRiftList([
  1. int? length
])
inherited

Read a RiftList with length.

If length is not provided, it is read first.

Implementation

@override
RiftList readRiftList([int? length]) {
  length ??= readUint32();
  final boxNameLength = readByte();
  final boxName = String.fromCharCodes(viewBytes(boxNameLength));
  final keys = List<dynamic>.filled(length, null, growable: true);
  for (var i = 0; i < length; i++) {
    keys[i] = readKey();
  }

  return RiftListImpl.lazy(boxName, keys);
}