decodeBound static method

(int, Uint8List, int) decodeBound(
  1. Uint8List data, [
  2. int offset = 0
])

Decodes a bound from bytes

Implementation

static (int timestamp, Uint8List idPrefix, int bytesConsumed) decodeBound(
  Uint8List data, [
  int offset = 0,
]) {
  final (timestamp, tsBytes) = decodeVarint(data, offset);
  final prefixLength = data[offset + tsBytes];
  final idPrefix = Uint8List.fromList(
    data.sublist(offset + tsBytes + 1, offset + tsBytes + 1 + prefixLength),
  );
  return (timestamp, idPrefix, tsBytes + 1 + prefixLength);
}