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

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

Go to download

ISO8583 Message Generator and Parser, Powered by j8583: http://j8583.sourceforge.net/

There is a newer version: 1.0.1-RELEASE
Show newest version
package com.solab.iso8583.parse;

import com.solab.iso8583.IsoType;

/**
 * Custom class to parse fields of type LLLBCDBIN with BCD length.
 */
public class BcdLengthLllbinParseInfo extends LllbinParseInfo {

    public BcdLengthLllbinParseInfo() {
        super(IsoType.LLLBCDBIN, 0);
    }

    @Override
    protected int getLengthForBinaryParsing(byte[] buf, int pos) {
        final int length = super.getLengthForBinaryParsing(buf, pos);
        return length % 2 == 0 ? length / 2 : (length / 2) + 1;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy