Class FieldCodecs

java.lang.Object
io.bytestreams.codec.iso8583.FieldCodecs

public final class FieldCodecs extends Object
Factory methods for commonly used ISO 8583 field codecs.
  • Method Details

    • singleBlockBitmap

      public static io.bytestreams.codec.core.Codec<SingleBlockBitmap> singleBlockBitmap(int size)
      Creates a codec for encoding and decoding a SingleBlockBitmap.
      Parameters:
      size - the number of bytes in the bitmap.
      Returns:
      the codec.
      Throws:
      IllegalArgumentException - if size is less than 1 or exceeds the maximum capacity.
    • multiBlockBitmap

      public static io.bytestreams.codec.core.Codec<MultiBlockBitmap> multiBlockBitmap(int size)
      Creates a codec for encoding and decoding a MultiBlockBitmap. Decoding reads blocks dynamically based on extension indicators.
      Parameters:
      size - the number of bytes per block.
      Returns:
      the codec.
      Throws:
      IllegalArgumentException - if size is less than 1 or exceeds the maximum capacity.
    • multiBlockBitmap

      public static io.bytestreams.codec.core.Codec<MultiBlockBitmap> multiBlockBitmap(int size, int maxBlocks)
      Creates a codec for encoding and decoding a MultiBlockBitmap with a maximum number of blocks. Decoding reads blocks dynamically based on extension indicators.
      Parameters:
      size - the number of bytes per block.
      maxBlocks - the maximum number of blocks.
      Returns:
      the codec.
      Throws:
      IllegalArgumentException - if size is less than 1 or exceeds the maximum capacity, or if maxBlocks is invalid for the given size.
    • tlvTag

      public static io.bytestreams.codec.core.Codec<String> tlvTag()
      Creates a codec for encoding and decoding BER-TLV tag identifiers as uppercase hex strings. Decoding reads bytes dynamically based on the tag structure.
      Returns:
      the codec.
    • tlvLength

      public static io.bytestreams.codec.core.Codec<Integer> tlvLength()
      Creates a codec for encoding and decoding BER-TLV length fields. Supports short form (0-127) and long form (128-2,147,483,647).
      Returns:
      the codec.