NetWrok.HTTP.Zlib.DeflateManager.SetParams C# (CSharp) Method

SetParams() private method

private SetParams ( ZlibCodec strm, CompressionLevel _level, CompressionStrategy _strategy ) : int
strm ZlibCodec
_level CompressionLevel
_strategy CompressionStrategy
return int
        internal int SetParams(ZlibCodec strm, CompressionLevel _level, CompressionStrategy _strategy)
        {
            int result = ZlibConstants.Z_OK;

            if (configTable [(int)compressionLevel].func != configTable [(int)_level].func && strm.TotalBytesIn != 0) {
                // Flush the last buffer:
                result = strm.Deflate (ZlibConstants.Z_PARTIAL_FLUSH);
            }

            if (compressionLevel != _level) {
                compressionLevel = _level;
                max_lazy_match = configTable [(int)compressionLevel].max_lazy;
                good_match = configTable [(int)compressionLevel].good_length;
                nice_match = configTable [(int)compressionLevel].nice_length;
                max_chain_length = configTable [(int)compressionLevel].max_chain;
            }
            compressionStrategy = _strategy;
            return result;
        }