|
reading a binary file with a RAF
I am working on a program where I am to access a binary file and read information from it, and use the info to perform different tasks. I know the file first has an index number of type long, and was told I must read the first 9 bits to see this. When I read in these bits and print them, it displays 000000050, which is what I want, the 50 part, but how do I actually make use of what I read in? Is there a good way to add each byte to a list and convert to an int?
Some of the data is not known as to how long the length or number of characters are in a string. The length is of type short. Is there a way to determine what the number bytes to read is?
|