File compression is organized as follows:
using (Stream fs = File.OpenRead(fileInput)) using (Stream fd = File.Create(FileOut)) using (Stream csStream = new GZipStream(fd, CompressionMode.Compress)) { byte[] buffer = new byte[1024]; int nRead; try { while ((nRead = fs.Read(buffer, 0, buffer.Length)) > 0) { csStream.Write(buffer, 0, nRead); } } Although it is written in msdn that GZip itself is able to distribute threads most efficiently, but in fact it turns out that the CPU load is only 25%. How can you modify this piece of code to use as much system resources as possible to speed up the compression process?