I am trying to read a binary file from a program that writes a log (of sorts) to a dat file which I have worked out reasonably well the format of using Java. I am loading it as so:
DataInputStream in = new DataInputStream(new FileInputStream("file.dat"));
System.out.println("Bytes skipped: " + in.skipBytes(4));
System.out.println(in.readLong());
The problem is the value from readLong() is different to what I am expecting, in Hex Workshop I highlight the hex blocks
BF02 0000
and reports that it is a valid signed short/long number - however the output is very different to what I am expecting. Looking at the Java Docs it states that it classes a long as 64 bit (8 bytes) whereas other sources show a signed long integer should be 32 bits - is there a way to get around this?
Cheers,
Tom