summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/uic/barcode/ssbFrame/SsbNonReservation.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/uic/barcode/ssbFrame/SsbNonReservation.java')
-rw-r--r--src/main/java/org/uic/barcode/ssbFrame/SsbNonReservation.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/org/uic/barcode/ssbFrame/SsbNonReservation.java b/src/main/java/org/uic/barcode/ssbFrame/SsbNonReservation.java
index e96e853..a1fb3ae 100644
--- a/src/main/java/org/uic/barcode/ssbFrame/SsbNonReservation.java
+++ b/src/main/java/org/uic/barcode/ssbFrame/SsbNonReservation.java
@@ -14,9 +14,9 @@ public class SsbNonReservation 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);
@@ -37,12 +37,14 @@ public class SsbNonReservation extends SsbCommonTicketPart {
text = bits.getChar6String(offset, 222);
offset = offset + 222;
+ 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);
@@ -55,7 +57,7 @@ public class SsbNonReservation extends SsbCommonTicketPart {
bits.putInteger(offset, 9, lastDayOfValidity);
offset = offset + 9;
- offset = stations.decode(offset, bytes);
+ offset = stations.encode(offset, bytes);
bits.putInteger(offset, 14, infoCode);
offset = offset + 14;
@@ -63,6 +65,8 @@ public class SsbNonReservation extends SsbCommonTicketPart {
bits.putChar6String(offset, 222, text);
offset = offset + 222;
+ return offset;
+
}
public int getFirstDayOfValidity() {