Class HEXInterpreter
java.lang.Object
org.jpos.iso.HEXInterpreter
- All Implemented Interfaces:
Interpreter
Implements BCD Interpreter. Numeric Strings (consisting of chars '0'..'9' are converted
to and from BCD bytes. Thus, "1234" is converted into 2 bytes: 0x12, 0x34.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HEXInterpreterThis HEXInterpreter sometimes adds a 0-nibble to the left.static final HEXInterpreterThis HEXInterpreter sometimes adds a F-nibble to the left.static final HEXInterpreterThis HEXInterpreter sometimes adds a 0-nibble to the right.static final HEXInterpreterThis HEXInterpreter sometimes adds a F-nibble to the right. -
Method Summary
Modifier and TypeMethodDescriptionintgetPackedLength(int nDataUnits) Each numeric digit is packed into a nibble, so 2 digits per byte, plus the possibility of padding.void(non-Javadoc)uninterpret(byte[] rawData, int offset, int length) (non-Javadoc)
-
Field Details
-
LEFT_PADDED
This HEXInterpreter sometimes adds a 0-nibble to the left. -
RIGHT_PADDED
This HEXInterpreter sometimes adds a 0-nibble to the right. -
RIGHT_PADDED_F
This HEXInterpreter sometimes adds a F-nibble to the right. -
LEFT_PADDED_F
This HEXInterpreter sometimes adds a F-nibble to the left.
-
-
Method Details
-
interpret
(non-Javadoc)- Specified by:
interpretin interfaceInterpreter
-
uninterpret
(non-Javadoc)- Specified by:
uninterpretin interfaceInterpreter- Parameters:
rawData- The interpreted data.offset- The index in rawData to start interpreting at.length- The number of data units to interpret.- Returns:
- The uninterpreted data.
-
getPackedLength
Each numeric digit is packed into a nibble, so 2 digits per byte, plus the possibility of padding.- Specified by:
getPackedLengthin interfaceInterpreter
-