parseInformation method

  1. @override
String parseInformation()
override

Implementation

@override
String parseInformation() {
  if (information.size < _HEADER_SIZE + AI01decoder.GTIN_SIZE) {
    throw NotFoundException.instance;
  }

  final buf = StringBuilder();

  encodeCompressedGtin(buf, _HEADER_SIZE);

  final lastAIdigit = generalDecoder.extractNumericValueFromBitArray(
    _HEADER_SIZE + AI01decoder.GTIN_SIZE,
    _LAST_DIGIT_SIZE,
  );
  buf.write('(392');
  buf.write(lastAIdigit);
  buf.write(')');

  final decodedInformation = generalDecoder.decodeGeneralPurposeField(
    _HEADER_SIZE + AI01decoder.GTIN_SIZE + _LAST_DIGIT_SIZE,
    null,
  );
  buf.write(decodedInformation.newString);

  return buf.toString();
}