summaryrefslogblamecommitdiffstats
path: root/src/main/java/org/uic/barcode/ssbFrame/SsbTicketPart.java
blob: 717608ab5700bb2ed802bc732fc01024f166a166 (plain) (tree)
1
2
3
4
5
6
7
8





                                                      

                                               



                                                                                           
                                        

          
                                                                        




                                                                                           
                                        

         
                                                                                                      





        
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;
	
	
	
	

}