encodeNullableListBytes<T> static method

Uint8List encodeNullableListBytes<T>(
  1. List<T?> items,
  2. void writeItem(
    1. RecordWriter w,
    2. T item
    )
)

Encodes a list of nullable items: [4B count][for each: 1B hasValue][item bytes (only if hasValue)].

Implementation

static Uint8List encodeNullableListBytes<T>(
  List<T?> items,
  void Function(RecordWriter w, T item) writeItem,
) {
  final w = RecordWriter();
  RecordWriterBase.writeNullableListPayload(w, items, writeItem);
  return w.takeFramedBytes();
}