Class EbcdicHexInterpreter
java.lang.Object
org.jpos.iso.EbcdicHexInterpreter
- All Implemented Interfaces:
BinaryInterpreter
Implements Hex Interpreter. The Hex digits are stored in EBCDIC.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EbcdicHexInterpreterAn instance of this Interpreter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPackedLength(int nBytes) Returns double nBytes because the hex representation of 1 byte needs 2 hex digits.voidinterpret(byte[] data, byte[] b, int offset) Converts the binary data into EBCDIC hex digits.byte[]uninterpret(byte[] rawData, int offset, int length) Converts the EBCDIC hex digits into binary data.
-
Field Details
-
INSTANCE
An instance of this Interpreter. Only one needed for the whole system
-
-
Constructor Details
-
EbcdicHexInterpreter
public EbcdicHexInterpreter()
-
-
Method Details
-
interpret
Converts the binary data into EBCDIC hex digits.- Specified by:
interpretin interfaceBinaryInterpreter- Parameters:
data- The data to be interpreted.b- The byte array to write the interpreted data to.offset- The starting position in b.
-
uninterpret
Converts the EBCDIC hex digits into binary data.- Specified by:
uninterpretin interfaceBinaryInterpreter- Parameters:
rawData- The interpreted data.offset- The index in rawData to start uninterpreting at.length- The number of uninterpreted bytes to uninterpret. This number may be different from the number of raw bytes that are uninterpreted.- Returns:
- The uninterpreted data.
-
getPackedLength
Returns double nBytes because the hex representation of 1 byte needs 2 hex digits.- Specified by:
getPackedLengthin interfaceBinaryInterpreter
-