예제 #1
0
 InternalByteStreamMessage(ByteStreamBufferedMessageData messageData, MessageHeaders headers, MessageProperties properties, XmlDictionaryReaderQuotas quotas, bool moveBodyReaderToContent)
 {
     this.headers    = new MessageHeaders(headers);
     this.properties = new MessageProperties(properties);
     this.bodyWriter = new BufferedBodyWriter(messageData);
     this.reader     = new XmlBufferedByteStreamReader(messageData, quotas);
     this.moveBodyReaderToContent = moveBodyReaderToContent;
 }
예제 #2
0
            protected override XmlDictionaryReader OnGetReaderAtBodyContents()
            {
                XmlDictionaryReader r = this.reader;

                this.reader = null;

                if ((r != null) && this.moveBodyReaderToContent)
                {
                    r.MoveToContent();
                }

                return(r);
            }
예제 #3
0
            public InternalByteStreamMessage(ByteStreamBufferedMessageData bufferedMessageData, XmlDictionaryReaderQuotas quotas, bool moveBodyReaderToContent)
            {
                // Assign both writer and reader here so that we can CreateBufferedCopy without the need to
                // abstract between a streamed or buffered message. We're protected here by the state on Message
                // preventing both a read/write.

                quotas = ByteStreamMessageUtility.EnsureQuotas(quotas);

                this.bodyWriter = new BufferedBodyWriter(bufferedMessageData);
                this.headers    = new MessageHeaders(MessageVersion.None);
                this.properties = new MessageProperties();
                this.reader     = new XmlBufferedByteStreamReader(bufferedMessageData, quotas);
                this.moveBodyReaderToContent = moveBodyReaderToContent;
            }
예제 #4
0
            public InternalByteStreamMessage(HttpResponseMessage httpResponseMessage, XmlDictionaryReaderQuotas quotas, bool moveBodyReaderToContent)
            {
                Fx.Assert(httpResponseMessage != null, "The 'httpResponseMessage' parameter should not be null.");

                // Assign both writer and reader here so that we can CreateBufferedCopy without the need to
                // abstract between a streamed or buffered message. We're protected here by the state on Message
                // preventing both a read/write on the same stream.

                quotas = ByteStreamMessageUtility.EnsureQuotas(quotas);

                this.bodyWriter = StreamedBodyWriter.Create(httpResponseMessage);
                this.headers    = new MessageHeaders(MessageVersion.None);
                this.properties = new MessageProperties();
                this.reader     = XmlStreamedByteStreamReader.Create(httpResponseMessage, quotas);
                this.moveBodyReaderToContent = moveBodyReaderToContent;
            }