<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">you can send async with exchange.getResponseSender().send(…, callback)<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 06.09.2017, at 03:38, Hicks, Matt &lt;<a href="mailto:matt@matthicks.com" class="">matt@matthicks.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Great, thanks! Are there any examples of using an OutputStream with Undertow?</p>
<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Sep 5, 2017, 4:39 PM Stuart Douglas &lt;<a href="mailto:sdouglas@redhat.com" class="">sdouglas@redhat.com</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My bad, I did not read your post properly and was thinking of gzip.<br class="">
<br class="">
I think you can still use ZipOutputStream though, it will only be<br class="">
blocking if the underlying Stream is blocking, so using something like<br class="">
a ByteArrayOutputStream would make the operation non blocking. If you<br class="">
want to avoid buffering the whole zip in memory you could potentially<br class="">
alternate between writing data to the ZipOutputStream and then taking<br class="">
anything written to the ByteArrayOutputStream and flushing it to the<br class="">
response channel.<br class="">
<br class="">
Stuart<br class="">
<br class="">
On Wed, Sep 6, 2017 at 1:31 AM, Hicks, Matt &lt;<a href="mailto:matt@matthicks.com" target="_blank" class="">matt@matthicks.com</a>&gt; wrote:<br class="">
&gt; I've looked at DeflatingStreamSinkConduit, but am at a loss to figure out<br class="">
&gt; how to adapt this to streaming a zip file.&nbsp; Is there any other information<br class="">
&gt; you could give me?<br class="">
&gt;<br class="">
&gt; Thanks<br class="">
&gt;<br class="">
&gt; On Thu, Aug 31, 2017 at 11:46 PM Stuart Douglas &lt;<a href="mailto:sdouglas@redhat.com" target="_blank" class="">sdouglas@redhat.com</a>&gt; wrote:<br class="">
&gt;&gt;<br class="">
&gt;&gt; You could potentially adapt<br class="">
&gt;&gt; io.undertow.conduits.DeflatingStreamSinkConduit, which uses a<br class="">
&gt;&gt; java.util.zip.Deflater.<br class="">
&gt;&gt;<br class="">
&gt;&gt; Stuart<br class="">
&gt;&gt;<br class="">
&gt;&gt; On Fri, Sep 1, 2017 at 5:57 AM, Hicks, Matt &lt;<a href="mailto:matt@matthicks.com" target="_blank" class="">matt@matthicks.com</a>&gt; wrote:<br class="">
&gt;&gt; &gt; I'm trying to create ZIP files on-demand from the server and stream them<br class="">
&gt;&gt; &gt; back to the browser, but I'm not sure the proper way to do this.&nbsp; The<br class="">
&gt;&gt; &gt; only<br class="">
&gt;&gt; &gt; way I can think of is to use a `ZipOutputStream`, but that would be a<br class="">
&gt;&gt; &gt; blocking operation.&nbsp; Is there a better way to do this?<br class="">
&gt;&gt; &gt;<br class="">
&gt;&gt; &gt; _______________________________________________<br class="">
&gt;&gt; &gt; undertow-dev mailing list<br class="">
&gt;&gt; &gt; <a href="mailto:undertow-dev@lists.jboss.org" target="_blank" class="">undertow-dev@lists.jboss.org</a><br class="">
&gt;&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank" class="">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br class="">
</blockquote></div>
_______________________________________________<br class="">undertow-dev mailing list<br class=""><a href="mailto:undertow-dev@lists.jboss.org" class="">undertow-dev@lists.jboss.org</a><br class="">https://lists.jboss.org/mailman/listinfo/undertow-dev</div></blockquote></div><br class=""></body></html>