summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/uic/barcode/ssbFrame/SsbTicketPart.java
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2023-03-14 10:31:01 +0100
committerGitHub <noreply@github.com>2023-03-14 10:31:01 +0100
commit4d2d3658c70347e9cffa049898b2b768bafe6174 (patch)
tree2b41ba728d15dace11d75a7d8b62976b69fcb379 /src/main/java/org/uic/barcode/ssbFrame/SsbTicketPart.java
parentcheck for inflater return code added (diff)
parentupdate version number (diff)
downloadUIC-barcode-1.4.0.tar
UIC-barcode-1.4.0.tar.gz
UIC-barcode-1.4.0.tar.bz2
UIC-barcode-1.4.0.tar.lz
UIC-barcode-1.4.0.tar.xz
UIC-barcode-1.4.0.tar.zst
UIC-barcode-1.4.0.zip
Diffstat (limited to 'src/main/java/org/uic/barcode/ssbFrame/SsbTicketPart.java')
-rw-r--r--src/main/java/org/uic/barcode/ssbFrame/SsbTicketPart.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/org/uic/barcode/ssbFrame/SsbTicketPart.java b/src/main/java/org/uic/barcode/ssbFrame/SsbTicketPart.java
new file mode 100644
index 0000000..717608a
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ssbFrame/SsbTicketPart.java
@@ -0,0 +1,31 @@
+package org.uic.barcode.ssbFrame;
+
+import org.uic.barcode.ticket.EncodingFormatException;
+
+public abstract class SsbTicketPart {
+
+ public static int openDataLength = 437;
+
+ public void decode(byte[] bytes) throws EncodingFormatException {
+ if (bytes.length != 114) {
+ throw new EncodingFormatException("Data size does not fit to SSB");
+ }
+ decodeContent(bytes, 0);
+ };
+
+ protected abstract int decodeContent(byte[] bytes , int offset);
+
+ public void encode(byte[] bytes) throws EncodingFormatException {
+ if (bytes.length != 114) {
+ throw new EncodingFormatException("Data size does not fit to SSB");
+ }
+ encodeContent(bytes, 0);
+ }
+
+ protected abstract int encodeContent(byte[] bytes, int offset) throws EncodingFormatException;
+
+
+
+
+
+}