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

inflate() public method

public inflate ( int f ) : int
f int
return int
        public int inflate(int f)
        {
            if (istate == null)
                return Z_STREAM_ERROR;
            return istate.inflate(this, f);
        }

Usage Example

Example #1
0
        private void WriteInternal(byte[] buffer, int offset, int count, int flush)
        {
            _zstream.next_in       = buffer;
            _zstream.next_in_index = offset;
            _zstream.avail_in      = count;

            while (true)
            {
                _zstream.next_out       = _block;
                _zstream.next_out_index = 0;
                _zstream.avail_out      = _block.Length;

                int err;
                if (_compress)
                {
                    err = _zstream.deflate(flush);
                }
                else
                {
                    err = _zstream.inflate(flush);
                }

                if (err != JZlib.Z_OK && (flush == JZlib.Z_FINISH && err != JZlib.Z_STREAM_END))
                {
                    throw new InvalidOperationException(string.Format("Error while {0}flating - {1}.", (_compress ? "de" : "in"), _zstream.msg));
                }

                _output.Write(_block, 0, _block.Length - _zstream.avail_out);

                if (_zstream.avail_out == 0)
                {
                    continue;
                }

                if (_zstream.avail_in == 0)
                {
                    break;
                }
            }
        }
All Usage Examples Of Rebex.IO.Compression.ZStream::inflate