compression Articles

Compressing in Memory using MemoryStream

Sometimes you need to compress entirely in memory. Here’s how to use a MemoryStream for this purpose: byte[] data = new byte[1000]; // We would expect a good compression ratio from an empty array! var msObj = new MemoryStream(); using (Stream ds = new DeflateStream (msObj, CompressionMode.Compress)) ds.Write (data, 0, data.Length); byte[] compressed = msObj.ToArray(); Console.WriteLine (compressed.Length); […]

Read more

Compression Using DeflateStream and GZipStream

The .NET System.IO.Compression namespace provides two general purpose compressions streams –  DeflateStream and GZipStream. Both these compressions streams use popular compression algorithm which is similar to that used by the ZIP format. The difference is that GZipStream writes an additional protocol at the start and at the end which includes a CRC to detect  errors. The GZipStream also […]

Read more

Compress and decompress strings in C#

A couple of days ago, I had to store some verybig strings in an XML file. To keep the file size down I wanted tocompress the strings using a GZipStream and then decompress them laterwhen needed. I modified the methods from Papenoo pa so they handled strings in stead of byte arrays. using System.IO.Compression;using System.Text;using […]

Read more

Introduction Zip Format

Introduction This is SQL Server Backup and restore tool, the system will store the backup files in standard Zip format ,the user-friendly screen let you backup and restore SQL Server database to local harddisk or remote network driver easily and quickly.The program can restore database easily. To do:1) First Enter Your Sql Server username and […]

Read more