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 required to interpret a String of length nDataUnits.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.- 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 required to interpret a String of length nDataUnits.
-