indexOf method

int indexOf(
  1. int value, [
  2. int start = 0
])

Returns the index of the first occurrence of the specified byte.

value the byte to search for start the starting index (optional) Returns -1 if not found

Implementation

int indexOf(int value, [int start = 0]) {
  for (int i = start; i < _bytes.length; i++) {
    if (_bytes[i] == value) return i;
  }
  return -1;
}