I agree that there appear to be plenty of workable solutions presented in this thread. Even this byte by byte stuff will work if you don't have to do it very often and how long it takes doesn't really matter.
Update: A few comments about buffer size... Bigger is not always "better". In my experience, increasing the buf size will have an effect up until a certain point. After that point, no gain is apparent. I recommend increments of 4K bytes (4096) because that is likely to be a "unit" that the file system deals with most naturally (as explained above). I suspect that the "sweet spot" in terms of buff size is likely to be 16 or 32 Kbytes. Typically going way bigger than that won't hurt, but it won't help either. When I really care, I make buffSize a variable and do some benchmarking. My advice is the result of my benchmarking experience on the O/S'es and systems that I commonly use - mileage certainly does vary. My point is: Bigger is not always "better". Note that with a truly huge buffer size, it is possible to have a dramatic slowdown if using such a large buffer causes swapping back and forth to the disk.
In reply to Re^6: Accessing individual bytes of a binary file as numerical values
by Marshall
in thread Accessing individual bytes of a binary file as numerical values
by Chris01234
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |