Ionic.Zlib.DeflateManager.Reset C# (CSharp) Method

Reset() private method

private Reset ( ) : void
return void
        internal void Reset()
        {
            _codec.TotalBytesIn = _codec.TotalBytesOut = 0;
            _codec.Message = null;
            //strm.data_type = Z_UNKNOWN;

            pendingCount = 0;
            nextPending = 0;

            Rfc1950BytesEmitted = false;

            status = (WantRfc1950HeaderBytes) ? INIT_STATE : BUSY_STATE;
            _codec._Adler32 = Adler.Adler32(0, null, 0, 0);

            last_flush = (int)FlushType.None;

            _InitializeTreeData();
            _InitializeLazyMatch();
        }

Usage Example

Example #1
0
 /// <summary>
 /// Reset a codec for another deflation session.
 /// </summary>
 /// <remarks>
 /// Call this to reset the deflation state.  For example if a thread is deflating
 /// non-consecutive blocks, you can call Reset() after the Deflate(Sync) of the first
 /// block and before the next Deflate(None) of the second block.
 /// </remarks>
 /// <returns>Z_OK if all goes well.</returns>
 public void ResetDeflate()
 {
     if (dstate == null)
     {
         throw new ZlibException("No Deflate State!");
     }
     dstate.Reset();
 }