org.jpos.iso
Interface Interpreter

All Known Implementing Classes:
AsciiInterpreter, BCDInterpreter, EbcdicInterpreter, LiteralInterpreter, SignedEbcdicNumberInterpreter

public interface Interpreter

Implementations convert Strings into byte arrays and vice versa.

Version:
$Revision$ $Date$
Author:
joconnor

Method Summary
 int getPackedLength(int nDataUnits)
          Returns the number of bytes required to interpret a String of length nDataUnits.
 void interpret(String data, byte[] b, int offset)
          Converts the string data into a different interpretation.
 String uninterpret(byte[] rawData, int offset, int length)
          Converts the byte array into a String.
 

Method Detail

interpret

void interpret(String data,
               byte[] b,
               int offset)
               throws ISOException
Converts the string data into a different interpretation. Standard interpretations are ASCII, EBCDIC, BCD and LITERAL.

Parameters:
data - The data to be interpreted.
Throws:
ISOException - on error

uninterpret

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.



Copyright © 1998-2012 jPOS.org. All Rights Reserved.