jPOS 1.6.1 API Documentation

org.jpos.iso
Class EbcdicPrefixer

java.lang.Object
  extended by org.jpos.iso.EbcdicPrefixer
All Implemented Interfaces:
Prefixer

public class EbcdicPrefixer
extends java.lang.Object
implements Prefixer

EbcdicPrefixer constructs a prefix for EBCDIC messages.

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

Field Summary
static EbcdicPrefixer LL
          A length prefixer for upto 99 chars.
static EbcdicPrefixer LLL
          A length prefixer for upto 999 chars.
static EbcdicPrefixer LLLL
          A length prefixer for upto 9999 chars.
 
Constructor Summary
EbcdicPrefixer(int nDigits)
           
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LL

public static final EbcdicPrefixer LL
A length prefixer for upto 99 chars. The length is encoded with 2 EBCDIC chars representing 2 decimal digits.


LLL

public static final EbcdicPrefixer LLL
A length prefixer for upto 999 chars. The length is encoded with 3 EBCDIC chars representing 3 decimal digits.


LLLL

public static final EbcdicPrefixer LLLL
A length prefixer for upto 9999 chars. The length is encoded with 4 EBCDIC chars representing 4 decimal digits.

Constructor Detail

EbcdicPrefixer

public EbcdicPrefixer(int nDigits)
Method Detail

encodeLength

public void encodeLength(int length,
                         byte[] b)
Description copied from interface: Prefixer
Fills a byte array with the field length data in raw form.

Specified by:
encodeLength in interface Prefixer
Parameters:
length - The length to be encoded.
b - The byte array to fill with the encoded length.

decodeLength

public int decodeLength(byte[] b,
                        int offset)
Description copied from interface: Prefixer
Decodes an encoded length.

Specified by:
decodeLength in interface Prefixer
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.

getPackedLength

public int getPackedLength()
Description copied from interface: Prefixer
Returns the number of bytes taken up by the length encoding.

Specified by:
getPackedLength in interface Prefixer

jPOS.org