Since nobody answered the thread on Binary File IO, I took a different approach.
Now I'm having another problem.
As I process a very large (>2GB) binary file, I store the byte position at certain points. Then, I reposition the file as needed.
I store the byte positions in a variable declared:
System.Int64 curr_pos;
However, the program fails when I position the file:
infile.Position = curr_pos;
I debug, and notice that this fails when the value of curr_pos gets over 2,147,483,647, which is the limit of a 32-bit integer. In fact, the value of curr_pos becomes negative, and that's the error I'm getting, that the value must be non-negative.
Why, since I explicitly declare the variable as 64-bit, does it fail when it reaches the 32-bit limit?