I have a file of 32 bit floating point numbers in binary that I want to read into a byte array in Java. How would I accomplish this?
I am using the File class and a FileInputStream to read the file but I am not sure about how I would read this correctly into a byte array. I would then like to loop through the array and display the values within it in Hex form or as a char.
I have been told to use a bitwise operation "& 0xff" to ensure the values in the array are correct - I am confused as to why this should be. Any explaination would be welcome.
Any advice would be appreciated?