Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to read a file of size >= 500 MB and i want to convert it to byte stream and write it as a binary file
Posted
Comments
Timberbird 2-Jun-11 9:27am    
Could you please clarify your question? Is your large file not binary? I mean, which kind of transformation are you going to perform on file content before saving it again?
Richard MacCutchan 2-Jun-11 9:29am    
It's already a binary file! Try explaining exactly what you want to do. Alternatively just read/write the file in manageable chunks and do your transformation on each block.

1 solution

You can use multithreading here. Reading the whole file is not recommended as it will be very slow, hence create buffers for each thread to store sections of the file. The threads will read from the assigned buffers and do the necessary operation.
Here is one brief answer which makes sense: http://stackoverflow.com/questions/3197187/multithreaded-file-writing[^].

Hope it helped.
 
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