jPOS 1.6.7 API Documentation

org.jpos.iso
Interface BinaryInterpreter

All Known Implementing Classes:
AsciiHexInterpreter, EbcdicHexInterpreter, LiteralBinaryInterpreter

public interface BinaryInterpreter

This interface supports the encoding and decoding of binary data. Common implementations are literal or no conversion, ASCII Hex, EBCDIC Hex and BCD.

Version:
$Revision: 2854 $ $Date: 2010-01-02 02:34:31 -0800 (Sat, 02 Jan 2010) $
Author:
joconnor

Method Summary
 int getPackedLength(int nBytes)
          Returns the number of bytes required to interpret a byte array of length nBytes.
 void interpret(byte[] data, byte[] b, int offset)
          Converts the binary data into a different interpretation or coding.
 byte[] uninterpret(byte[] rawData, int offset, int length)
          Converts the raw byte array into a uninterpreted byte array.
 

Method Detail

interpret

void interpret(byte[] data,
               byte[] b,
               int offset)
Converts the binary data into a different interpretation or coding. Standard interpretations are ASCII Hex, EBCDIC Hex, BCD and LITERAL.

Parameters:
data - The data to be interpreted.
b - The byte array to write the interpreted data to.
offset - The starting position in b.

uninterpret

byte[] uninterpret(byte[] rawData,
                   int offset,
                   int length)
Converts the raw byte array into a uninterpreted byte array. This reverses the interpret method.

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

int getPackedLength(int nBytes)
Returns the number of bytes required to interpret a byte array of length nBytes.


jPOS.org