This is what we do (YMMV).
1. Have a xml packager that defines the fields for the messages in a the packager xml file. Note field are defined IFE_*, where E is for EBCDIC.
<isopackager>
<isofield
id="0"
length="4"
name="MESSAGE TYPE INDICATOR"
pad="true"
class="org.jpos.iso.IFE_NUMERIC"/>
<isofield
id="1"
length="16"
name="BIT MAP"
class="org.jpos.iso.IFB_BITMAP"/>
<isofield
id="2"
length="19"
name="PAN - PRIMARY ACCOUNT NUMBER"
pad="false"
class="org.jpos.iso.IFE_LLNUM"
<isofield
id="3"
length="6"
name="PROCESSING CODE"
pad="true"
class="org.jpos.iso.IFE_NUMERIC"/>
...
...
2. Read the header bytes.
3. Read the bytes preceeding the MTI and determine the length of the message to read.
4. Read the message bytes.
5. Setup the ISOMsg and assign the packager to it.
6. Use the message bytes and unpack it using the isomsg object.
7. Each field irrespective of the type (EBCDIC etc ) will be available to you as a string.
8. You may have some trailer after messages (@'s, you may need to skip those).
9. You may have some boundary separator chars (@@ at regular intervals, I think we had them at 1021 bytes, skip those, these may come anywhere in between message length, or message data, skip them.
8. Loop to 3 till end of file.
10. I do believe the files come in slightly different formats based on some post processing done on them, so your mileage may vary.
-chhil