这是代码:
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)