All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.solab.iso8583.parse.BinLengthLlNumParseInfo Maven / Gradle / Ivy

Go to download

Java implementation of the ISO 8583 protocol, focused on making the creation, edition and reading of ISO8583 messages as simple and flexible as possible.

There is a newer version: 1.22.5
Show newest version
package com.solab.iso8583.parse;

import com.solab.iso8583.IsoType;

/**
 * Custom parser for fields of type {@link IsoType#LLBINLENGTHNUM}.
 */
public class BinLengthLlNumParseInfo extends LlbinParseInfo {

    /**
     * Instantiates a new Bin length ll num parse info.
     */
    public BinLengthLlNumParseInfo() {
        super(IsoType.LLBINLENGTHNUM, 0);
    }

    @Override
    protected int getLengthForBinaryParsing(byte b) {
        int intLength = Byte.toUnsignedInt(b);
        return intLength / 2 + intLength % 2;
    }

    @Override
    protected int getFieldLength(byte b) {
        return Byte.toUnsignedInt(b);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy