I have ISO packaged file contains all its records on single line. File contents like MTI1XXXXXXMTI2XXXXMTI1XXXXX So here total 3 rows which are on single line.
ISOMsg isoMsg = new ISOMsg();
isoMsg.setPackager(packager);
isoMsg.unpack(filedata);`
isoMsg only able to unpack first record MTI1XXXXXX
Here MTI1, MTI2, MTI3 are Message Type Indicator (MTI) which is of 4 digits.
If I separate those records(3 lines) in file and read line by line like below
MTI1XXXXXX
MTI2XXXX
MTI1XXXXX
It returns me all the records. Is there any way to read all records which are on single line using JPOS ISO8583 packager or with generic packager?
adding my sample code snippet:
InputStream lis = null;
try {
GenericPackager packager;
packager = new GenericPackager("src/main/resources/BitMapConfig.xml");
lis = new FileInputStream("src/test/resources/isoTestFile");
ISOMsg isoMsg = new ISOMsg();
isoMsg.setPackager(packager);
isoMsg.unpack(lis);
ISOBitMap bitmap = (ISOBitMap) isoMsg.getComponent(-1);
System.out.println("bitmap.getValue::" + bitmap.getValue()); //returns only first records bitmap whoever file contains 3 MTI on single line
} catch (Exception e) {
e.printStackTrace();
}
I want to read all of those and separate those in different files.