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;
}