getDataBytes method

Uint8List getDataBytes()

Implementation

Uint8List getDataBytes() {
  switch (mode) {
    case Mode.ASCII:
      if (input.isECI(fromPosition)) {
        return getBytes(241, input.getECIValue(fromPosition) + 1);
      } else if (MinimalEncoder.isExtendedASCII(
        input.charAt(fromPosition),
        input.fnc1Character,
      )) {
        return getBytes(235, input.charAt(fromPosition) - 127);
      } else if (characterLength == 2) {
        return getBytes(
          (input.charAt(fromPosition) - 48 /*'0'*/) * 10 +
              input.charAt(fromPosition + 1) -
              48 +
              130,
        );
      } else if (input.isFNC1(fromPosition)) {
        return getBytes(232);
      } else {
        return getBytes(input.charAt(fromPosition) + 1);
      }
    case Mode.B256:
      return getBytes(input.charAt(fromPosition));
    case Mode.C40:
      return getC40Words(true, input.fnc1Character);
    case Mode.TEXT:
      return getC40Words(false, input.fnc1Character);
    case Mode.X12:
      return getX12Words();
    case Mode.EDF:
      return getEDFBytes();
  }
}