June 13th, 2012, 06:53 PM
Binary File. Extract float data from binary file and put into array
I have a binary file that contains floating point numbers and is in little endian (this last part I don't think is very important). I would like to read the numbers from this file and and put them into an array.
I have done some research and I cannot figure out how to do this. I know that there are InputStream, FileInputStream, DataInputStream, and BinaryInputStream classes that have the methods that will get this done, but I have not been successful at anything. I know that FileInputStream takes a file as its constructor and that DataInputStream has readFloat().
Does anyone know of code on the Internet that already does this? Or can anyone help me out with advice, guidance, code, etc.?
June 13th, 2012, 08:16 PM
What do you mean when you say the file contains floating point numbers?
Can you look at the contents of the file with a hex editor and post the first 8 bytes of the file here in hex?
How was the file created? Have you tried the DataInputStream class readFloat() method?