Package org.jpos.iso
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getPackedLength(int nDataUnits)
Returns the number of bytes required to interpret a String of length nDataUnits.void
interpret(java.lang.String data, byte[] b, int offset)
Converts the string data into a different interpretation.java.lang.String
uninterpret(byte[] rawData, int offset, int length)
Converts the byte array into a String.
-
-
-
Method Detail
-
interpret
void interpret(java.lang.String data, byte[] b, int offset) throws ISOException
Converts the string data into a different interpretation. Standard interpretations are ASCII, EBCDIC, BCD and LITERAL.- Throws:
ISOException
- on error
-
uninterpret
java.lang.String uninterpret(byte[] rawData, int offset, int length) throws ISOException
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
int getPackedLength(int nDataUnits)
Returns the number of bytes required to interpret a String of length nDataUnits.
-
-