public class BCDInterpreter extends java.lang.Object implements Interpreter
Modifier and Type | Field and Description |
---|---|
static BCDInterpreter |
LEFT_PADDED
This BCDInterpreter sometimes adds a 0-nibble to the left.
|
static BCDInterpreter |
LEFT_PADDED_F
This BCDInterpreter sometimes adds a F-nibble to the left.
|
static BCDInterpreter |
RIGHT_PADDED
This BCDInterpreter sometimes adds a 0-nibble to the right.
|
static BCDInterpreter |
RIGHT_PADDED_F
This BCDInterpreter sometimes adds a F-nibble to the right.
|
Modifier and Type | Method and Description |
---|---|
int |
getPackedLength(int nDataUnits)
Each numeric digit is packed into a nibble, so 2 digits per byte, plus the
possibility of padding.
|
void |
interpret(java.lang.String data,
byte[] b,
int offset)
(non-Javadoc)
|
java.lang.String |
uninterpret(byte[] rawData,
int offset,
int length)
(non-Javadoc)
|
public static final BCDInterpreter LEFT_PADDED
public static final BCDInterpreter RIGHT_PADDED
public static final BCDInterpreter RIGHT_PADDED_F
public static final BCDInterpreter LEFT_PADDED_F
public void interpret(java.lang.String data, byte[] b, int offset)
interpret
in interface Interpreter
public java.lang.String uninterpret(byte[] rawData, int offset, int length)
uninterpret
in interface Interpreter
rawData
- The interpreted data.offset
- The index in rawData to start interpreting at.length
- The number of data units to interpret.public int getPackedLength(int nDataUnits)
getPackedLength
in interface Interpreter