小编Ale*_*est的帖子

如何解析十六进制iso8583行?

这是代码:

import org.jpos.iso.packager.ISO87BPackager;
import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOUtil;

public class ParseISOMsg {
    public static void main(String[] args) throws ISOException {
        String hexmsg = "3038313082200000020000000400000000000000111312532012345630300301";
        // convert hex string to byte array
        byte[] bmsg =ISOUtil.hex2byte(hexmsg);
        ISOMsg m = new ISOMsg();
        // set packager, change ISO87BPackager for the matching one.
        m.setPackager(new ISO87BPackager());
        //unpack the message using the packager
        m.unpack(bmsg);
        //dump the message to standar output
        m.dump(System.out, "");
    }
}
Run Code Online (Sandbox Code Playgroud)

现在发出异常:

Exception in thread "main" org.jpos.iso.ISOException: org.jpos.iso.IFB_NUMERIC: Problem unpacking field 23 (java.lang.ArrayIndexOutOfBoundsException: …
Run Code Online (Sandbox Code Playgroud)

java iso8583

4
推荐指数
1
解决办法
951
查看次数

标签 统计

iso8583 ×1

java ×1