trimStart static method

List<int> trimStart(
  1. List<int> bytes
)

Remove a series of 0x00 in the header

Implementation

static List<int> trimStart(List<int> bytes) {
  if (bytes.isEmpty) return [];
  int i = 0;
  while (bytes[i] == 0x00) {
    i++;
    if (i >= bytes.length) {
      return [];
    }
  }
  return bytes.sublist(i, bytes.length);
}