readVec method

List readVec(
  1. dynamic cb(
    1. BcsReader reader,
    2. int i,
    3. int length
    )
)

Read a BCS vector: read a length and then apply function cb X times where X is the length of the vector, defined as ULEB in BCS bytes.

Array of the resulting values, returned by callback.

Implementation

List<dynamic> readVec(dynamic Function(BcsReader reader, int i, int length) cb) {
  int length = readULEB();
  final result = <dynamic>[];
  for (int i = 0; i < length; i++) {
    result.add(cb(this, i, length));
  }
  return result;
}