Skip to content
James Craig edited this page Jun 11, 2014 · 1 revision

The compression system, as the name suggests, deals with compressing strings and byte arrays. Generally there are only a couple of extension methods that you will care about when dealing with this system. First is the Compress extension method:

"This is an example".Compress();

The compress extension attaches to either a string or byte array and will compress it using either Deflate or GZip depending on which is specified. By default it uses Deflate. Similarly you can use Decompress to get the string back:

"Something, something, dark side".Compress().Decompress();

The code above would compress the string using Deflate and then decompress it using Deflate. Another nice feature of the system is you can actually hook up your own compression algorithms by simply implementing the ICompressor interface in the Utilities.IO.Compression.Interfaces namespace.

Clone this wiki locally