peekNextByte method

int? peekNextByte()

Return the next byte in the buffer without modifying the read pointer. Returns the int value of the next byte or null if no data is available

Implementation

int? peekNextByte() {
  // No data available
  if (_bufferedChunks.isEmpty || length < 1) {
    return null;
  }

  return _bufferedChunks.first[_usedHeadBytes];
}