readWritables<W extends Writable> method

List<W> readWritables<W extends Writable>(
  1. W reader(
    1. BytesBuffer input
    ), {
  2. bool leb128 = false,
})

Reads a list of Writable using the reader function to instantiate the W elements.

Implementation

List<W> readWritables<W extends Writable>(
    W Function(BytesBuffer input) reader,
    {bool leb128 = false}) {
  int sz;
  if (leb128) {
    sz = readLeb128UnsignedInt();
  } else {
    sz = readInt32();
  }

  var list = List.generate(sz, (i) => reader(this));
  return list;
}