diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2023-07-28 14:14:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 14:14:36 +0200 |
commit | 69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb (patch) | |
tree | 280e81fe489f5a3944e0c8b8199019377c57eef0 /src/main | |
parent | Merge pull request #68 from UnionInternationalCheminsdeFer/customerCardV1 (diff) | |
parent | - decode TLB also in case of wrong non-numeric formating of number (diff) | |
download | UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.gz UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.bz2 UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.lz UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.xz UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.zst UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.zip |
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/uic/barcode/staticFrame/DataRecord.java | 2 | ||||
-rw-r--r-- | src/main/java/org/uic/barcode/staticFrame/UTLAYDataRecord.java | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/org/uic/barcode/staticFrame/DataRecord.java b/src/main/java/org/uic/barcode/staticFrame/DataRecord.java index 16d3811..2b5fa42 100644 --- a/src/main/java/org/uic/barcode/staticFrame/DataRecord.java +++ b/src/main/java/org/uic/barcode/staticFrame/DataRecord.java @@ -106,7 +106,7 @@ public abstract class DataRecord { String dataSize = new String(Arrays.copyOfRange(byteData, offset, offset + 4));
offset = offset + 4;
- int length = Integer.parseInt(dataSize) - 12;
+ int length = Integer.parseInt(dataSize.trim()) - 12;
this.setData(Arrays.copyOfRange(byteData, offset, offset + length));
decodeContent();
diff --git a/src/main/java/org/uic/barcode/staticFrame/UTLAYDataRecord.java b/src/main/java/org/uic/barcode/staticFrame/UTLAYDataRecord.java index 2d403e4..0c2869a 100644 --- a/src/main/java/org/uic/barcode/staticFrame/UTLAYDataRecord.java +++ b/src/main/java/org/uic/barcode/staticFrame/UTLAYDataRecord.java @@ -125,7 +125,7 @@ public class UTLAYDataRecord extends DataRecord { int elements = 0;
try {
- elements = Integer.parseInt(numberValue);
+ elements = Integer.parseInt(numberValue.trim());
} catch(NumberFormatException e){
//Do Nothing
}
@@ -138,7 +138,7 @@ public class UTLAYDataRecord extends DataRecord { offset = offset + 2;
int line = 0;
try {
- line = Integer.parseInt(lineValue);
+ line = Integer.parseInt(lineValue.trim());
} catch(NumberFormatException e){
//Do Nothing
}
@@ -146,7 +146,7 @@ public class UTLAYDataRecord extends DataRecord { offset = offset + 2;
int column = 0;
try {
- column = Integer.parseInt(columnValue);
+ column = Integer.parseInt(columnValue.trim());
} catch(NumberFormatException e){
//Do Nothing
}
@@ -154,7 +154,7 @@ public class UTLAYDataRecord extends DataRecord { offset = offset + 2;
int height = 0;
try {
- height = Integer.parseInt(heightValue);
+ height = Integer.parseInt(heightValue.trim());
} catch(NumberFormatException e){
//Do Nothing
}
@@ -162,7 +162,7 @@ public class UTLAYDataRecord extends DataRecord { offset = offset + 2;
int width = 0;
try {
- width = Integer.parseInt(widthValue);
+ width = Integer.parseInt(widthValue.trim());
} catch(NumberFormatException e){
//Do Nothing
}
@@ -170,7 +170,7 @@ public class UTLAYDataRecord extends DataRecord { offset = offset + 1;
int format = 0;
try {
- format = Integer.parseInt(formatValue);
+ format = Integer.parseInt(formatValue.trim());
} catch(NumberFormatException e){
//Do Nothing
}
@@ -178,7 +178,7 @@ public class UTLAYDataRecord extends DataRecord { offset = offset + 4;
int length = 0;
try {
- length = Integer.parseInt(lengthValue);
+ length = Integer.parseInt(lengthValue.trim());
} catch(NumberFormatException e){
//Do Nothing
}
|