se*************@gmail.com wrote:
What's the general accepted strategy for dealing with very large
binary files in C# ?
Very large binary files? Read a little bit at a time.
I have to do a program that reads some "multi frame bitmap " files
which can reach up to one hundred megs so I need to know how to
optimize reading a file..
Oh. I thought you were asking about "very large binary files". These
days, 100MB isn't really all that big. :)
That said, you are likely to find that the most important issue is to
make sure you read enough data at one time. You can use a
BufferedStream to ensure this, but my experience has been that even
FileStream has some built-in buffering (caching at the OS level) that
results in pretty good performance anyway.
Do you have a specific issue that is coming up in which performance is
not satisfactory? Generally, it's better to not waste time optimizing
until you know what performance problem you're trying to solve. Until
you have an actual performance problem, you can't answer that.
Pete