absorbBits method

void absorbBits(
  1. int data,
  2. int bits
)
inherited

Implementation

void absorbBits(int data, int bits) {
  if (bits < 1 || bits > 7) {
    throw StateError('"bits" must be in the range 1 to 7');
  }
  if ((_bitsInQueue % 8) != 0) {
    throw StateError('attempt to absorb with odd length queue');
  }
  if (_squeezing) {
    throw StateError('attempt to absorb while squeezing');
  }
  var mask = (1 << bits) - 1;
  _dataQueue[_bitsInQueue >> 3] = data & mask;
  _bitsInQueue += bits;
}