ComponentAce.Compression.Libs.ZLib.ZStream.deflateEnd C# (CSharp) Method

deflateEnd() public method

All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output.
public deflateEnd ( ) : int
return int
		public int deflateEnd()
		{
		 next_in_index = 0;
		 next_out_index = 0;

			if (_dstate == null)
				return (int)ZLibResultCode.Z_STREAM_ERROR;
			int ret = _dstate.deflateEnd();
			_dstate = null;
			return ret;
		}

Usage Example

Example #1
0
            internal static int Process(zlib.ZStream /*!*/ zst, MutableString str, zlib.FlushStrategy flush, bool compress,
                                        out MutableString /*!*/ result, ref MutableString trailingUncompressedData)
            {
                result = MutableString.CreateBinary();

                // add previously compressed data to the output:
                if (zst.next_out != null)
                {
                    result.Append(zst.next_out, 0, zst.next_out_index);
                }

                int err;
                int bufferStart = zst.next_out_index;

                err = Process(zst, str, flush, compress, ref trailingUncompressedData);
                result.Append(zst.next_out, bufferStart, zst.next_out_index - bufferStart);

                if (err == Z_STREAM_END && (flush == zlib.FlushStrategy.Z_FINISH || str == null))
                {
                    err = compress ? zst.deflateEnd() : zst.inflateEnd();
                }

                zst.next_out       = null;
                zst.next_out_index = 0;
                zst.avail_out      = 0;

                return(err);
            }
All Usage Examples Of ComponentAce.Compression.Libs.ZLib.ZStream::deflateEnd