Package org.jpos.iso
Class LiteralBinaryInterpreter
- java.lang.Object
-
- org.jpos.iso.LiteralBinaryInterpreter
-
- All Implemented Interfaces:
BinaryInterpreter
public class LiteralBinaryInterpreter extends java.lang.Object implements BinaryInterpreter
This interpreter does no conversion and leaves the input the same as the output.
-
-
Field Summary
Fields Modifier and Type Field Description static LiteralBinaryInterpreter
INSTANCE
The only instance of this interpreter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPackedLength(int nBytes)
Returns nBytes because we are not doing any conversion.void
interpret(byte[] data, byte[] b, int offset)
Copies the input to the output.byte[]
uninterpret(byte[] rawData, int offset, int length)
Copies the data out of the byte array.
-
-
-
Field Detail
-
INSTANCE
public static final LiteralBinaryInterpreter INSTANCE
The only instance of this interpreter.
-
-
Method Detail
-
interpret
public void interpret(byte[] data, byte[] b, int offset)
Copies the input to the output.- Specified by:
interpret
in interfaceBinaryInterpreter
- Parameters:
data
- The data to be interpreted.b
- The byte array to write the interpreted data to.offset
- The starting position in b.
-
uninterpret
public byte[] uninterpret(byte[] rawData, int offset, int length)
Copies the data out of the byte array.- Specified by:
uninterpret
in interfaceBinaryInterpreter
- Parameters:
rawData
- The interpreted data.offset
- The index in rawData to start uninterpreting at.length
- The number of uninterpreted bytes to uninterpret. This number may be different from the number of raw bytes that are uninterpreted.- Returns:
- The uninterpreted data.
-
getPackedLength
public int getPackedLength(int nBytes)
Returns nBytes because we are not doing any conversion.- Specified by:
getPackedLength
in interfaceBinaryInterpreter
-
-