Package io.bytestreams.codec.iso8583
Class FieldCodecs
java.lang.Object
io.bytestreams.codec.iso8583.FieldCodecs
Factory methods for commonly used ISO 8583 field codecs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.bytestreams.codec.core.Codec<MultiBlockBitmap> multiBlockBitmap(int size) Creates a codec for encoding and decoding aMultiBlockBitmap.static io.bytestreams.codec.core.Codec<MultiBlockBitmap> multiBlockBitmap(int size, int maxBlocks) Creates a codec for encoding and decoding aMultiBlockBitmapwith a maximum number of blocks.static io.bytestreams.codec.core.Codec<SingleBlockBitmap> singleBlockBitmap(int size) Creates a codec for encoding and decoding aSingleBlockBitmap.static io.bytestreams.codec.core.Codec<Integer> Creates a codec for encoding and decoding BER-TLV length fields.static io.bytestreams.codec.core.Codec<String> tlvTag()Creates a codec for encoding and decoding BER-TLV tag identifiers as uppercase hex strings.
-
Method Details
-
singleBlockBitmap
Creates a codec for encoding and decoding aSingleBlockBitmap.- Parameters:
size- the number of bytes in the bitmap.- Returns:
- the codec.
- Throws:
IllegalArgumentException- ifsizeis less than 1 or exceeds the maximum capacity.
-
multiBlockBitmap
Creates a codec for encoding and decoding aMultiBlockBitmap. Decoding reads blocks dynamically based on extension indicators.- Parameters:
size- the number of bytes per block.- Returns:
- the codec.
- Throws:
IllegalArgumentException- ifsizeis 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 aMultiBlockBitmapwith 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- ifsizeis less than 1 or exceeds the maximum capacity, or ifmaxBlocksis invalid for the given size.
-
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
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.
-