* Append length info. On success, store the result in "bits".
(numLetters: number /*int*/, version: Version, mode: Mode, bits: BitArray)
| 490 | * Append length info. On success, store the result in "bits". |
| 491 | */ |
| 492 | public static appendLengthInfo(numLetters: number /*int*/, version: Version, mode: Mode, bits: BitArray): void /*throws WriterException*/ { |
| 493 | const numBits = mode.getCharacterCountBits(version); |
| 494 | if (numLetters >= (1 << numBits)) { |
| 495 | throw new WriterException(numLetters + ' is bigger than ' + ((1 << numBits) - 1)); |
| 496 | } |
| 497 | bits.appendBits(numLetters, numBits); |
| 498 | } |
| 499 | |
| 500 | /** |
| 501 | * Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits". |
no test coverage detected