Converting EBCDIC To ASCII In Java
Answer : If I am interpreting this format correctly you have a binary file format with fixed-length records. Some of these records are not character data (COBOL computational fields?) So, you will have to read the records using a more low-level approach processing individual fields of each record: import java.io.*; public class Record { private byte[] kdgex = new byte[2]; // COMP private byte[] b1code = new byte[2]; // COMP private byte[] b1number = new byte[8]; // DISPLAY // other fields public void read(DataInput data) throws IOException { data.readFully(kdgex); data.readFully(b1code); data.readFully(b1number); // other fields } public void write(DataOutput out) throws IOException { out.write(kdgex); out.write(b1code); out.write(b1number); // other fields } } Here I've used byte arrays for the first three fields of the record but you could use other more suitable types where appropriate (like a short for the first field with rea...