jPOS 1.6.1 API Documentation

org.jpos.iso
Interface Prefixer

All Known Implementing Classes:
AsciiPrefixer, BcdPrefixer, BinaryPrefixer, EbcdicPrefixer, NullPrefixer

public interface Prefixer

This interface is used to encode and decode length prefixes.

Version:
$Revision: 2594 $ $Date: 2008-01-22 08:41:31 -0800 (Tue, 22 Jan 2008) $
Author:
joconnor

Method Summary
 int decodeLength(byte[] b, int offset)
          Decodes an encoded length.
 void encodeLength(int length, byte[] b)
          Fills a byte array with the field length data in raw form.
 int getPackedLength()
          Returns the number of bytes taken up by the length encoding.
 

Method Detail

encodeLength

void encodeLength(int length,
                  byte[] b)
                  throws ISOException
Fills a byte array with the field length data in raw form.

Parameters:
length - The length to be encoded.
b - The byte array to fill with the encoded length.
Throws:
ISOException

decodeLength

int decodeLength(byte[] b,
                 int offset)
                 throws ISOException
Decodes an encoded length.

Parameters:
b - The byte array to scan for the length.
offset - The offset to start scanning from.
Returns:
The length in chars of the field data to follow this LengthPrefix.
Throws:
ISOException

getPackedLength

int getPackedLength()
Returns the number of bytes taken up by the length encoding.


jPOS.org