Interface Prefixer

All Known Implementing Classes:
AsciiPrefixer, BcdPrefixer, BinaryPrefixer, EbcdicPrefixer, HexNibblesPrefixer, IF_FBINARY.FullyConsumingPrefixer, IF_FCHAR.FullyConsumingPrefixer, NullPrefixer

public interface Prefixer
This interface is used to encode and decode length prefixes.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    decodeLength(byte[] b, int offset)
    Decodes an encoded length from the byte array.
    void
    encodeLength(int length, byte[] b)
    Encodes the field length into the byte array.
    int
    Returns the number of bytes taken up by the length encoding.
  • Method Details

    • encodeLength

      void encodeLength(int length, byte[] b) throws ISOException
      Encodes the field length into the byte array.
      Parameters:
      length - the field length to encode
      b - the byte array to write the length prefix into
      Throws:
      ISOException - if the length exceeds the prefix capacity
    • decodeLength

      int decodeLength(byte[] b, int offset) throws ISOException
      Decodes an encoded length from the byte array.
      Parameters:
      b - the byte array containing the length prefix
      offset - the offset in b where the prefix starts
      Returns:
      the length in chars of the field data to follow this prefix
      Throws:
      ISOException - if the prefix cannot be decoded
    • getPackedLength

      Returns the number of bytes taken up by the length encoding.
      Returns:
      the number of bytes used by the length encoding