Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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;
        }
Beispiel #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;
        }