appendLengthInfo static method
Append length info. On success, store the result in "bits".
Implementation
static void appendLengthInfo(
int numLetters,
Version version,
Mode mode,
BitArray bits,
) {
final numBits = mode.getCharacterCountBits(version);
if (numLetters >= (1 << numBits)) {
throw WriterException(
'$numLetters is bigger than ${((1 << numBits) - 1)}',
);
}
bits.appendBits(numLetters, numBits);
}