summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/uic/barcode/ssbFrame/SsbGroup.java
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2023-03-10 16:49:58 +0100
committerCGantert345 <57003061+CGantert345@users.noreply.github.com>2023-03-10 16:49:58 +0100
commit7ec06722923d96d2e51300bafb44b920ca341d58 (patch)
tree3a3635f56092a4fe1d6c15d88872ea699fb97666 /src/main/java/org/uic/barcode/ssbFrame/SsbGroup.java
parentssb added to encoder and decoder (diff)
downloadUIC-barcode-7ec06722923d96d2e51300bafb44b920ca341d58.tar
UIC-barcode-7ec06722923d96d2e51300bafb44b920ca341d58.tar.gz
UIC-barcode-7ec06722923d96d2e51300bafb44b920ca341d58.tar.bz2
UIC-barcode-7ec06722923d96d2e51300bafb44b920ca341d58.tar.lz
UIC-barcode-7ec06722923d96d2e51300bafb44b920ca341d58.tar.xz
UIC-barcode-7ec06722923d96d2e51300bafb44b920ca341d58.tar.zst
UIC-barcode-7ec06722923d96d2e51300bafb44b920ca341d58.zip
Diffstat (limited to 'src/main/java/org/uic/barcode/ssbFrame/SsbGroup.java')
-rw-r--r--src/main/java/org/uic/barcode/ssbFrame/SsbGroup.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/org/uic/barcode/ssbFrame/SsbGroup.java b/src/main/java/org/uic/barcode/ssbFrame/SsbGroup.java
index 52c3a52..1b2f6e7 100644
--- a/src/main/java/org/uic/barcode/ssbFrame/SsbGroup.java
+++ b/src/main/java/org/uic/barcode/ssbFrame/SsbGroup.java
@@ -18,9 +18,9 @@ public class SsbGroup extends SsbCommonTicketPart {
@Override
- protected void decodeContent(byte[] bytes) {
+ protected int decodeContent(byte[] bytes, int offset) {
- int offset = decodeCommonPart(bytes);
+ offset = offset + decodeCommonPart(bytes);
BitBuffer bits = new ByteBitBuffer(bytes);
@@ -44,15 +44,17 @@ public class SsbGroup extends SsbCommonTicketPart {
infoCode = bits.getInteger(offset, 14);
offset = offset + 14;
- text = bits.getChar6String(offset, 222);
- offset = offset + 222;
+ text = bits.getChar6String(offset, 144);
+ offset = offset + 144;
+
+ return offset;
}
@Override
- protected void encodeContent(byte[] bytes) {
+ protected int encodeContent(byte[] bytes, int offset) {
- int offset = encodeCommonPart(bytes);
+ offset = offset + encodeCommonPart(bytes, offset);
BitBuffer bits = new ByteBitBuffer(bytes);
@@ -65,7 +67,7 @@ public class SsbGroup extends SsbCommonTicketPart {
bits.putInteger(offset, 9, lastDayOfValidity);
offset = offset + 9;
- offset = stations.decode(offset, bytes);
+ offset = stations.encode(offset, bytes);
bits.putChar6String(offset, 72,groupName);
offset = offset + 72;
@@ -77,8 +79,9 @@ public class SsbGroup extends SsbCommonTicketPart {
offset = offset + 14;
bits.putChar6String(offset, 144, text);
- offset = offset + 222;
+ offset = offset + 144;
+ return offset;
}
public int getFirstDayOfValidity() {