@@ -100,13 +100,13 @@ public void Disassemble(IPipelineContext pContext, IBaseMessage pInMsg)
100100 //If the request has a body it should be preserved an the query parameters should be written to it's own message part.
101101 if ( hasData )
102102 {
103- string msgType = GetMessageType ( MakeMarkable ( pInMsg . BodyPart . Data ) , null ) ;
103+ string msgType = GetMessageType ( MakeMarkable ( pInMsg . BodyPart . Data ) ) ;
104104
105105 outMsg = pInMsg ;
106106 outMsg . BodyPart . Data = pInMsg . BodyPart . Data ;
107-
107+
108108 outMsg . Context = PipelineUtil . CloneMessageContext ( pInMsg . Context ) ;
109- outMsg . Context . Promote ( new ContextProperty ( SystemProperties . MessageType ) , msgType ) ;
109+ outMsg . Context . Promote ( new ContextProperty ( SystemProperties . MessageType ) , msgType ) ;
110110 var factory = pContext . GetMessageFactory ( ) ;
111111 var queryPart = factory . CreateMessagePart ( ) ;
112112 queryPart . Data = ms ;
@@ -145,7 +145,7 @@ public IBaseMessage GetNext(IPipelineContext pContext)
145145
146146 return null ;
147147 }
148-
148+
149149 private MarkableForwardOnlyEventingReadStream MakeMarkable ( Stream stream )
150150 {
151151 MarkableForwardOnlyEventingReadStream eventingReadStream = null ;
@@ -154,27 +154,21 @@ private MarkableForwardOnlyEventingReadStream MakeMarkable(Stream stream)
154154 {
155155 eventingReadStream = stream as MarkableForwardOnlyEventingReadStream ?? new MarkableForwardOnlyEventingReadStream ( stream ) ;
156156 }
157-
157+
158158 return eventingReadStream ;
159159 }
160160
161- private string GetMessageType ( MarkableForwardOnlyEventingReadStream stm , Encoding encoding )
161+ private string GetMessageType ( MarkableForwardOnlyEventingReadStream stm )
162162 {
163163 string msgType = null ;
164164
165165 stm . MarkPosition ( ) ;
166166 try
167167 {
168168 XmlTextReader xmlTextReader = null ;
169- if ( encoding != null )
170- {
171- xmlTextReader = new XmlTextReader ( new StreamReader ( stm , encoding ) ) ;
172- }
173- else
174- {
175- xmlTextReader = new XmlTextReader ( ( Stream ) stm ) ;
176- }
177-
169+
170+ xmlTextReader = new XmlTextReader ( ( Stream ) stm ) ;
171+
178172 while ( msgType == null )
179173 {
180174 if ( xmlTextReader . Read ( ) )
@@ -205,7 +199,7 @@ private string GetMessageType(MarkableForwardOnlyEventingReadStream stm, Encodin
205199 }
206200 private bool HasData ( Stream data )
207201 {
208- byte [ ] buffer = new byte [ 10 ] ;
202+ byte [ ] buffer = new byte [ 10 ] ;
209203 const int bufferSize = 0x280 ;
210204 const int thresholdSize = 0x100000 ;
211205
0 commit comments