I need to combine multiple files (video & music & text) into single file with a custom file type (for example:
*.abcd) and custom file data structure , and the file should only be read by my program and my program should be able to separate parts of this file. How do this in .net & c#? -- my file has any size , for example 300 MB , 500 MB or 1 GB and merged file's size is about 1.5 or 2 GB , how i do it ? .. (using stream or memory stream ?!!)Code
https://www.imageupload.co.uk/image/ZWnh
Johannes Funch2 pointsPosted Jun 18, 2015, 2:01 AM EDT
If you're going to simply store them then extract them later, all you need is a simple directory structure that you store at the beginning. This directory will have information such as offset, size, type and original file name of each section. You can then dump the different files as sections after the header.
You could also apply encryption on the segments before saving them. This post discusses this:
http://stackoverflow.com/questions/5090233/how-to-encrpyt-decrypt-data-in-chunks
The real problem will be if you want to play back the video and music in your application and not just store them. Depending on which mix of formats you want to support, you might want to use an SDK that has strong support for different formats such as Leadtools.