CSharp examples for System.IO.Compression:Zip
Zip Binary byte array
using System.Text; using System.IO.Compression; using System.IO;// ww w. ja v a 2 s . com using System.Collections.Generic; using System; public class Main{ public static byte[] ZipBinary(byte[] rawSource) { memDestination = new MemoryStream(); memSource = new MemoryStream(rawSource); gzipStream = new GZipStream(memDestination, CompressionMode.Compress); Streamer.CopyStream(memSource, gzipStream); gzipStream.Close(); return memDestination.ToArray(); } }