Rebex.IO.Compression.ZStream.deflateInit C# (CSharp) Method

deflateInit() public method

public deflateInit ( int level ) : int
level int
return int
        public int deflateInit(int level)
        {
            return deflateInit(level, MAX_WBITS);
        }

Same methods

ZStream::deflateInit ( int level, bool nowrap ) : int
ZStream::deflateInit ( int level, int bits ) : int
ZStream::deflateInit ( int level, int bits, bool nowrap ) : int

Usage Example

Example #1
0
        /// <summary>
        /// Creates a new instance of <see cref="ZlibOutputStream"/> class.
        /// </summary>
        /// <param name="output">Underlying stream that will receive the processed data written to the <see cref="ZlibOutputStream"/> instance.</param>
        /// <param name="mode">Specifies whether to compress or decompress data written to the stream.</param>
        /// <param name="level">Compresion level. Only used when compressing data.</param>
        public ZlibOutputStream(Stream output, CompressionMode mode, int level)
        {
            if (output == null)
            {
                throw new ArgumentNullException("input");
            }

            level = Math.Max(0, Math.Min(9, level));

            _block    = new byte[0x1000];
            _output   = output;
            _compress = mode == CompressionMode.Compress;
            _zstream  = new ZStream();
            if (_compress)
            {
                _zstream.deflateInit(level, false);
            }
            else
            {
                _zstream.inflateInit();
            }
        }
All Usage Examples Of Rebex.IO.Compression.ZStream::deflateInit