Tag: GZip

Sep 09

GZip Compression and Decompression in C#

In .NET GZipStream¬†class in¬†System.IO.Compression provides methods and properties to compress and decompress streams. Below example shows how to compress and decompress large binary data   CompressorHelper.cs public class CompressorHelper { public static byte[] DecompressGZip(byte[] bytesToDecompress) { using (var stream = new GZipStream(new MemoryStream(bytesToDecompress), CompressionMode.Decompress)) { const int size = 4096; var buffer = new byte[size]; …

Continue reading »