find_leb128bytes function

FindLeb128BytesTuple find_leb128bytes(
  1. Uint8List bytes,
  2. int start_i
)

Finds where the leb128 bytes finish in a list of bytes. Returns a FindLeb128BytesTuple.

Implementation

FindLeb128BytesTuple find_leb128bytes(Uint8List bytes, int start_i) {
    int c = start_i;
    while (bytes[c] >= 128) {
        c += 1;
    }
    int next_i = c + 1;
    Uint8List leb128_bytes = bytes.sublist(start_i, next_i);
    return FindLeb128BytesTuple(leb128_bytes, next_i);
}