Ejemplo n.º 1
0
        public HttpContentCompressor(int compressionLevel, int windowBits, int memLevel, int contentSizeThreshold)
        {
            if (compressionLevel < 0 || compressionLevel > 9)
            {
                ThrowHelper.ThrowArgumentException_CompressionLevel(compressionLevel);
            }
            if (windowBits < 9 || windowBits > 15)
            {
                ThrowHelper.ThrowArgumentException_WindowBits(windowBits);
            }
            if (memLevel < 1 || memLevel > 9)
            {
                ThrowHelper.ThrowArgumentException_MemLevel(memLevel);
            }
            if (contentSizeThreshold < 0)
            {
                ThrowHelper.ThrowArgumentException_PositiveOrZero(contentSizeThreshold, ExceptionArgument.contentSizeThreshold);
            }

            this.compressionLevel     = compressionLevel;
            this.windowBits           = windowBits;
            this.memLevel             = memLevel;
            this.contentSizeThreshold = contentSizeThreshold;
        }