Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I am trying to read a big binary file (around 50 MB) with a BinaryStream in C#.So, reading all the data in a single instruction, as Read() method takes some time.

Do you know any method that I can use to read the data faster ?Maybe, how can I read it from different sections of the file in the same time using differet threads ?

Thank you
Posted

1 solution

Using different threads would be insane. You're reading a file, you thnk your hard drive will magically read different sectors without some penalty ? I do believe it's possible to open a file and read it in chunks, however. But you won't get your data any faster, adding more code will slow it down, but only a miniscule amount, and you can access your initial data faster. If you need all the data to use it, then what you have is your best option, it's limited by the speed of the HDD and you can't change that in code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900