compact method

  1. @override
bool compact()
override

Compact the internal bytes capacity to length.

Implementation

@override
bool compact() {
  if (_length < _capacity) {
    _io.truncateSync(_length);
    _ioCapacity = _capacity = _length;
    _ioSetPosition(_position);
    return true;
  }
  return false;
}