decodeListBytes<T> static method

List<T> decodeListBytes<T>(
  1. Uint8List framed,
  2. T readItem(
    1. RecordReader r
    )
)

Decodes a list of @HybridRecord objects from framed bytes.

Implementation

static List<T> decodeListBytes<T>(
  Uint8List framed,
  T Function(RecordReader r) readItem,
) {
  final r = RecordReader.fromFramedBytes(framed);
  final count = r.readInt32();
  return List.generate(count, (_) => readItem(r));
}