Deflate() public method

Deflate one batch of data.
You must have set InputBuffer and OutputBuffer before calling this method.
public Deflate ( int flush ) : int
flush int whether to flush all data as you deflate. Generally you will want to /// use Z_NO_FLUSH here, in a series of calls to Deflate(), and then call EndDeflate() to /// flush everything. ///
return int
Example #1
0
        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;
        }