trimLeadingZero static method

BuBytes trimLeadingZero(
  1. List<int> bytes
)

Drops leading zero bytes from bytes.

Implementation

static BuBytes trimLeadingZero(List<int> bytes) {
  int offset = 0;
  while (offset < bytes.length) {
    if (bytes[offset] != 0) break;
    offset++;
  }
  return BuBytes(bytes.sublist(offset));
}