title: Compressing and decompressing very large files using System.IO.Compressing.Gzip
body: <p>My problem can be described with following statements:</p>
  
  <ul>
  <li>I would like my program to be able to compress and decompress selected files</li>
  <li>I have very large files (20 GB+). It is safe to assume that the size will never fit into the memory</li>
  <li>Even after compression the compressed file might still not fit into the memory</li>
  <li>I would like to use System.IO.Compression.GzipStream from <strong>.NET Framework</strong></li>
  <li>I would like my application to be parallel</li>
  </ul>
  
  <p>As I am a newbie to compression / decompression I had following idea on how to do it:</p>
  
  <p>I could use split the files into chunks and compress each of them separately. Then merge them back into a whole compressed file.
  <a href="https://i.stack.imgur.com/NASZ8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NASZ8.png" alt="Picture showing my idea"></a></p>
  
  <p><strong>Question 1 about this approach</strong> - Is compressing multiple chunks and then merging them back together going to give me the proper result i.e. if I were to reverse the process (starting from compressed file, back to decompressed) will I receive the same original input?</p>
  
  <p><strong>Question 2 about this approach</strong> - Does this approach make sense to you? Perhaps you could direct me towards some good lecture about the topic? Unfortunately I could not find anything myself.</p>