I have a binary file that contains 10-bit fixed point values that I need to convert to Java float
. I'm almost certain that the "format" is x.xxxxxxxxx
, where x is a bit. And I do think I understand the basics of doing this by hand.
I would have to do to the bits: x + 0.5*x + 0,25*x...
etc. For example
1010110010 = 1×1 + 0×½ + 1×¼ + 0×⅛ + 1×¹⁄₁₆ + 1×¹⁄₃₂...
But I have no idea how to do this in Java. I can read the file only one BYTE at a time, one value would be reading 2 bytes = 16 bits.
The file is in LITTLE ENDIAN.