checkUnflushedBits method

void checkUnflushedBits()

Checks for unflushed bits using hasUnflushedBits and throws a StateError if there are any bits that haven't been written.

Implementation

void checkUnflushedBits() {
  if (hasUnflushedBits) {
    throw StateError("Unflushed bits: $_bitsBufferLength");
  }
}