예제 #1
0
        protected virtual void WriteBody(Stream output, BodyBuffer bodyBuffer)
        {
            // argument checks
            Debug.Assert(output != null);
            Debug.Assert(bodyBuffer != null);

            // write message body
            bodyBuffer.WriteBody(output);
        }
예제 #2
0
        protected virtual void RedirectBody(Stream output, BodyBuffer bodyBuffer)
        {
            // argument checks
            Debug.Assert(output != null);
            Debug.Assert(bodyBuffer != null);

            // write message body
            bodyBuffer.RedirectBody(output, this.ContentLength);
        }
예제 #3
0
        protected Message()
        {
            // initialize members
            this.headerBuffer  = new HeaderBuffer();
            this.bodyBuffer    = new BodyBuffer(this.headerBuffer);
            this.modifications = new List <MessageBuffer.Modification>();
            ResetThisClassLevelMessageProperties();
            this.ReadingState = MessageReadingState.Error;

            return;
        }
예제 #4
0
        protected virtual void ScanBody(BodyBuffer bodyBuffer)
        {
            // argument checks
            Debug.Assert(bodyBuffer != null);

            // scan body
            if (this.ContentLength == -1)
            {
                // chunked body
                bodyBuffer.SkipChunkedBody();
            }
            else
            {
                // simple body
                // Call bodyBuffer.SkipBody() even if bodyLength is 0 to process prefetched bytes.
                bodyBuffer.SkipBody(this.ContentLength);
            }

            return;
        }