Class AsciiInterpreter
java.lang.Object
org.jpos.iso.AsciiInterpreter
- All Implemented Interfaces:
Interpreter
Implements ASCII Interpreter. Strings are converted to and from ASCII bytes.
This uses the US-ASCII encoding which all JVMs must support.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPackedLength(int nDataUnits) (non-Javadoc)void(non-Javadoc)uninterpret(byte[] rawData, int offset, int length) (non-Javadoc)
-
Field Details
-
INSTANCE
An instance of this Interpreter. Only one needed for the whole system
-
-
Constructor Details
-
AsciiInterpreter
public AsciiInterpreter()Public constructor; preferINSTANCEfor repeated use.
-
-
Method Details
-
interpret
(non-Javadoc)- Specified by:
interpretin interfaceInterpreter- Parameters:
data- the string data to interpretb- the target byte arrayoffset- the offset inbto start writing at
-
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
(non-Javadoc)- Specified by:
getPackedLengthin interfaceInterpreter- Parameters:
nDataUnits- the number of logical data units- Returns:
- the packed byte length
-