parseInformation method

  1. @override
String parseInformation()
override

Implementation

@override
String parseInformation() {
  if (information.size < _headerSize + AI01Decoder.gtinSize) {
    throw NotFoundException.instance;
  }

  final buf = StringBuilder();

  encodeCompressedGtin(buf, _headerSize);

  final lastAIdigit = generalDecoder.extractNumericValueFromBitArray(
    _headerSize + AI01Decoder.gtinSize,
    _lastDigitSize,
  );
  buf.write('(392');
  buf.write(lastAIdigit);
  buf.write(')');

  final decodedInformation = generalDecoder.decodeGeneralPurposeField(
    _headerSize + AI01Decoder.gtinSize + _lastDigitSize,
    null,
  );
  buf.write(decodedInformation.newString);

  return buf.toString();
}