ServiceStack.StreamExt.CompressBytes C# (CSharp) Méthode

CompressBytes() public static méthode

Compresses the specified text using the default compression method: Deflate
public static CompressBytes ( this bytes, string compressionType ) : byte[]
bytes this
compressionType string
Résultat byte[]
        public static byte[] CompressBytes(this byte[] bytes, string compressionType)
        {
            if (compressionType == CompressionTypes.Deflate)
                return DeflateProvider.Deflate(bytes);

            if (compressionType == CompressionTypes.GZip)
                return GZipProvider.GZip(bytes);

            throw new NotSupportedException(compressionType);
        }