Interface Interpreter
- All Known Implementing Classes:
AsciiInterpreter, BCDInterpreter, EbcdicInterpreter, HEXInterpreter, LiteralInterpreter, SignedEbcdicNumberInterpreter
public interface Interpreter
Implementations convert Strings into byte arrays and vice versa.
-
Method Summary
Modifier and TypeMethodDescriptionintgetPackedLength(int nDataUnits) Returns the number of bytes needed to storenDataUnitsdata units in this interpretation.voidConverts the string data into a different interpretation.uninterpret(byte[] rawData, int offset, int length) Converts the byte array into a String.
-
Method Details
-
interpret
Converts the string data into a different interpretation. Standard interpretations are ASCII, EBCDIC, BCD and LITERAL.- Parameters:
data- the string data to interpretb- the target byte arrayoffset- the offset inbto start writing at- Throws:
ISOException- on error
-
uninterpret
Converts the byte array into a String. This reverses the interpret method.- 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.
- Throws:
ISOException- on error
-
getPackedLength
Returns the number of bytes needed to storenDataUnitsdata units in this interpretation.- Parameters:
nDataUnits- the number of logical data units- Returns:
- the packed byte length
-