Read File Bit By Bit
Posted on 2001-07-19
I have a file that has columns of data. I don't yet understand the file format allthough I do have a document that tells me what is contained in each column. I must write a routine to display this data as ascii text. In order to read this file, I want to start at the beginning of the file and determine each bit as a 1 or 0. It appears that the format could be something like this.
110 'first three bits describe the length of
'the next field. etc...
When I figure out the structure, it should be possible to read the next n bits and convert to ascii and display.
Seems the place to start is to look at the file as bits.
I have viewed the file with a hex editor, but the hex and hex to ascii makes no sense. Perhaps as in the 110 example above, the hex editor does not know where to start and stop reading, therefore gibberish.
I can make a RichTextBox to contain the 1's and 0's, this will help figure out the structure based on my discription document, but I have not been successful in reading the file this way. How to do it?