shiftAndAppend method

State shiftAndAppend(
  1. HighLevelEncoderMode mode,
  2. int value
)

Implementation

State shiftAndAppend(HighLevelEncoderMode mode, int value) {
  //assert binaryShiftByteCount == 0 && this.mode != mode;
  Token token = _token;
  final int thisModeBitCount = _mode == HighLevelEncoderMode.digit ? 4 : 5;
  // Shifts exist only to UPPER and PUNCT, both with tokens size 5.
  token = token.add(
    HighLevelEncoder.shiftTable[_mode.index][mode.index],
    thisModeBitCount,
  );
  token = token.add(value, 5);
  return State(token, _mode, 0, _bitCount + thisModeBitCount + 5);
}