ServiceStack.StreamExt.CompressBytes C# (CSharp) 메소드

CompressBytes() 공개 정적인 메소드

Compresses the specified text using the default compression method: Deflate
public static CompressBytes ( this bytes, string compressionType ) : byte[]
bytes this
compressionType string
리턴 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);
        }