appendBytes static method

void appendBytes(
  1. String content,
  2. Mode mode,
  3. BitArray bits,
  4. Encoding encoding,
)

Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits".

Implementation

static void appendBytes(
  String content,
  Mode mode,
  BitArray bits,
  Encoding encoding,
) {
  switch (mode) {
    case Mode.numeric:
      appendNumericBytes(content, bits);
      break;
    case Mode.alphanumeric:
      appendAlphanumericBytes(content, bits);
      break;
    case Mode.byte:
      append8BitBytes(content, bits, encoding);
      break;
    case Mode.kanji:
      appendKanjiBytes(content, bits);
      break;
    default:
      throw WriterException('Invalid mode: $mode');
  }
}