<div dir="ltr">Here is Stuarts response from a similar question.<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">You need to implement org.xnio.conduits.</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">StreamSinkConduit and add io.</span><span class="gmail-il" style="font-size:12.8px;background-color:rgb(255,255,255)">undertow</span><span style="font-size:12.8px">.server.</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">HttpServerExchange#</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">addResponseWrapper</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">There is no simple in memory representation of the </span><span class="gmail-il" style="font-size:12.8px;background-color:rgb(255,255,255)">response</span><span style="font-size:12.8px">, because it may be to large for the server to buffer (or more likely the server does not want to buffer it for performance reasons). Implementing this will allow you to </span><span class="gmail-il" style="font-size:12.8px;background-color:rgb(255,255,255)">modify</span><span style="font-size:12.8px"> the </span><span class="gmail-il" style="font-size:12.8px;background-color:rgb(255,255,255)">response</span><span style="font-size:12.8px"> as it is being written.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Stuart</span><br></blockquote></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 29, 2016 at 1:56 AM, 翟 小斌 <span dir="ltr">&lt;<a href="mailto:zhai-xiaobin@hotmail.com" target="_blank">zhai-xiaobin@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div id="m_-5586391958602067278divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif" dir="ltr">
<p><span><span style="font-family:Calibri,Arial,Helvetica,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,NotoColorEmoji,&quot;Segoe UI Symbol&quot;,&quot;Android Emoji&quot;,EmojiSymbols;font-size:16px"><span id="m_-5586391958602067278ouHighlight__0_1TO0_2" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px">How
 to</span><span id="m_-5586391958602067278noHighlight_0.9273977068878834" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"> </span><span id="m_-5586391958602067278ouHighlight__2_3TO7_9" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px">get</span><span id="m_-5586391958602067278noHighlight_0.5432009730178675" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"> the </span> response
 body in </span>undertow HttpHandler ?</span><br>
</p>
<p><span id="m_-5586391958602067278ouHighlight__0_0TO0_0" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px">I</span><span id="m_-5586391958602067278noHighlight_0.38125974001653007" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"> </span><span id="m_-5586391958602067278ouHighlight__1_2TO2_5" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px">need</span><span id="m_-5586391958602067278noHighlight_0.16922569537892396" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"> to </span><span id="m_-5586391958602067278ouHighlight__16_17TO10_15" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px">modify <span id="m_-5586391958602067278ouHighlight__18_25TO36_43">response</span><span id="m_-5586391958602067278noHighlight_0.9727541682239245"> </span><span id="m_-5586391958602067278ouHighlight__27_33TO45_51">cont<wbr>ent</span></span><span id="m_-5586391958602067278noHighlight_0.4661806322066737" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"> </span><span id="m_-5586391958602067278ouHighlight__3_3TO17_18" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px">in</span><span id="m_-5586391958602067278noHighlight_0.2724665374729449" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"> the </span><span id="m_-5586391958602067278ouHighlight__4_14TO24_35" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px">httpHandler. </span></p>
<p><span style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"><span id="m_-5586391958602067278noHighlight_0.7198352532421164" style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"></span></span></p>
<p><span style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"><span style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"><br>
</span></span></p>
<p><span style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"><span style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px">thanks
 all.</span></span></p>
<p><span style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"><span style="color:rgb(85,85,85);font-family:&quot;Segoe UI&quot;,Tahoma,Helvetica,sans-serif;font-size:13px"><br>
</span></span></p>
</div>
</div>

<br>______________________________<wbr>_________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br></blockquote></div><br></div>