ServiceStack.StreamExt.Compress C# (CSharp) Method

Compress() public static method

Compresses the specified text using the default compression method: Deflate
public static Compress ( this text, string compressionType ) : byte[]
text this The text.
compressionType string Type of the compression.
return byte[]
        public static byte[] Compress(this string text, string compressionType)
        {
            if (compressionType == CompressionTypes.Deflate)
                return Deflate(text);

            if (compressionType == CompressionTypes.GZip)
                return GZip(text);

            throw new NotSupportedException(compressionType);
        }