Reading Binary File using java
I am trying to read a binary file using java and I am getting weird results. I will explain the background a little better.
I am working on a legacy system called Advantage Plus and it's database is called Metropolis. The Metropolis database is very similar to mainframe VSAM file (if you know about VSAM KSDS). Each database contains a 512 byte database header with some info and the actual data starts from 513th byte. Each database has a corresponding record layout in a file called copybook. The binary data file is in AIX 5.3 and I downloaded into my local PC (Intel P4) to read it.
I am trying to read a file called lecfil.dbd and its copybook is lecfil.cpy.
For string fields, I am getting the expected results. However, for the binary (byte) fields, I am not getting the correct results. Can some one help?
I have attached my source code which uses the RandomAccessFile class, also attached my data file and a screenshot of actual data in the data file.