Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
srowen committed Sep 24, 2022
1 parent a6273e3 commit fa19d47
Showing 1 changed file with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,22 +220,38 @@ static int decodeMacroBlock(int[] codewords, int codeIndex, PDF417ResultMetadata
case MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:
ECIStringBuilder segmentCount = new ECIStringBuilder();
codeIndex = numericCompaction(codewords, codeIndex + 1, segmentCount);
resultMetadata.setSegmentCount(Integer.parseInt(segmentCount.toString()));
try {
resultMetadata.setSegmentCount(Integer.parseInt(segmentCount.toString()));
} catch (NumberFormatException nfe) {
throw FormatException.getFormatInstance();
}
break;
case MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:
ECIStringBuilder timestamp = new ECIStringBuilder();
codeIndex = numericCompaction(codewords, codeIndex + 1, timestamp);
resultMetadata.setTimestamp(Long.parseLong(timestamp.toString()));
try {
resultMetadata.setTimestamp(Long.parseLong(timestamp.toString()));
} catch (NumberFormatException nfe) {
throw FormatException.getFormatInstance();
}
break;
case MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:
ECIStringBuilder checksum = new ECIStringBuilder();
codeIndex = numericCompaction(codewords, codeIndex + 1, checksum);
resultMetadata.setChecksum(Integer.parseInt(checksum.toString()));
try {
resultMetadata.setChecksum(Integer.parseInt(checksum.toString()));
} catch (NumberFormatException nfe) {
throw FormatException.getFormatInstance();
}
break;
case MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:
ECIStringBuilder fileSize = new ECIStringBuilder();
codeIndex = numericCompaction(codewords, codeIndex + 1, fileSize);
resultMetadata.setFileSize(Long.parseLong(fileSize.toString()));
try {
resultMetadata.setFileSize(Long.parseLong(fileSize.toString()));
} catch (NumberFormatException nfe) {
throw FormatException.getFormatInstance();
}
break;
default:
throw FormatException.getFormatInstance();
Expand Down

0 comments on commit fa19d47

Please sign in to comment.