rewind method Null safety

  1. @override
void rewind(
  1. [int length = 1]
)
override

Rewind the read head of the stream by the given number of bytes.

Implementation

@override
void rewind([int length = 1]) {
  if ((_bufferPosition - length) < 0) {
    _position = max(_position - length, 0);
    _readBuffer();
    return;
  }
  _bufferPosition -= length;
  _position -= length;
}