public void Reset() { if (TransferEncoding != TransferEncoding.None) { ContentTransform.End(); ContentTransform = null; } StringQueue = null; chunkLen = chunkIndex = CurrentReadBytes = 0; State = BodyParserState.Dormant; TransferEncoding = TransferEncoding.None; CompressionType = CompressionType.Unknown; ContentLength = -1; IsSet = false; }
public void Finish() { ThrowIfEnded(); if (!IsSet) { throw new InvalidOperationException("Not set"); } if (IsCompressionSet) { // compressed data footer CompressorDuplex compressor = ContentTransform as CompressorDuplex; compressor.Finish(); WriteTransformed(compressor.Read()); } WriteTransformed(null); IsSet = false; ContentTransform.End(); IsCompressionSet = false; TransferEncoding = TransferEncoding.None; Compression = CompressionType.Unknown; ContentLength = -1; }