summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2023-02-10 14:22:57 +0100
committerCGantert345 <57003061+CGantert345@users.noreply.github.com>2023-02-10 14:22:57 +0100
commitd86d66e0ac0c296d813e985217299a4a900a5e49 (patch)
tree63d87d9cdb56efa6cbf984fb6755d385605b0ef5 /src/main
parentsupport for SSB barcodes (diff)
downloadUIC-barcode-d86d66e0ac0c296d813e985217299a4a900a5e49.tar
UIC-barcode-d86d66e0ac0c296d813e985217299a4a900a5e49.tar.gz
UIC-barcode-d86d66e0ac0c296d813e985217299a4a900a5e49.tar.bz2
UIC-barcode-d86d66e0ac0c296d813e985217299a4a900a5e49.tar.lz
UIC-barcode-d86d66e0ac0c296d813e985217299a4a900a5e49.tar.xz
UIC-barcode-d86d66e0ac0c296d813e985217299a4a900a5e49.tar.zst
UIC-barcode-d86d66e0ac0c296d813e985217299a4a900a5e49.zip
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java b/src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java
index 22ba8ce..fdef178 100644
--- a/src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java
+++ b/src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java
@@ -224,6 +224,16 @@ public class UHEADDataRecord extends DataRecord{
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
String issuerElement = String.format("%4s", this.issuer);
+
+ if (this.identifier == null || this.identifier.length() < 1) {
+ throw new EncodingFormatException("Identifier in U_HEAD missing");
+ }
+
+ if (this.identifier.length() > 20) {
+ throw new EncodingFormatException("Identifier in U_HEAD too long (max. 20 byte)");
+ }
+
+
String idElement = String.format("%20s", this.identifier);