resetRead method

void resetRead({
  1. bool hard = false,
})

Reset the read offsets in the buffer.

If hard is true, reset the _recordedReadCount accumulator. If hard is false (default), add the current readCount to the _recordedReadCount.

Implementation

void resetRead({bool hard = false}) {
  _recordedReadCount = hard ? 0 : _recordedReadCount + readCount;
  readCount = 0;
}