Example #1
0
        /// <summary> Process one task </summary>
        /// <param name="task"> Compression or decompression gzip task </param>
        public void ProcessTask(GZipTask task)
        {
            var fileChunk = _fileManager.ReadFileChunk(task.FilePathParams.InputFilePath,
                                                       task.FileChunk.StartPosition, task.FileChunk.ReadBytes);

            var chunk = task.Operation.ProcessChunk(fileChunk);

            // After parallel execution of read and process operation
            // executed sequential write to file operation
            WriteToFile(task, chunk);
        }