Paul
2008-04-18 08:16:43 UTC
Hi,
I have some binary data with a 2 byte word described as follows:
LSB 08 09 10 11 12 13 14 00 MSB
LSB 00 01 02 03 04 05 06 07 MSB
I know this is supposed to be an unsigned integer value, but when I try
reading it from the file as a 2 byte int e.g. short or unsigned short I do
not get the correct value (I know what the rangee of values are).
It was suggested that each byte may have been written back to front! Is
there any way I can swap the order of the bits to try to get what looks like
a reasonable value? (I think the data may have been written using some old
HP proprietary format.)
Any suggestions most welcome
Paul
I have some binary data with a 2 byte word described as follows:
LSB 08 09 10 11 12 13 14 00 MSB
LSB 00 01 02 03 04 05 06 07 MSB
I know this is supposed to be an unsigned integer value, but when I try
reading it from the file as a 2 byte int e.g. short or unsigned short I do
not get the correct value (I know what the rangee of values are).
It was suggested that each byte may have been written back to front! Is
there any way I can swap the order of the bits to try to get what looks like
a reasonable value? (I think the data may have been written using some old
HP proprietary format.)
Any suggestions most welcome
Paul