<p dir="ltr">Great, thanks! Are there any examples of using an OutputStream with Undertow?</p>
<br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 5, 2017, 4:39 PM Stuart Douglas &lt;<a href="mailto:sdouglas@redhat.com">sdouglas@redhat.com</a>&gt; wrote:<br></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>
<br>
I think you can still use ZipOutputStream though, it will only be<br>
blocking if the underlying Stream is blocking, so using something like<br>
a ByteArrayOutputStream would make the operation non blocking. If you<br>
want to avoid buffering the whole zip in memory you could potentially<br>
alternate between writing data to the ZipOutputStream and then taking<br>
anything written to the ByteArrayOutputStream and flushing it to the<br>
response channel.<br>
<br>
Stuart<br>
<br>
On Wed, Sep 6, 2017 at 1:31 AM, Hicks, Matt &lt;<a href="mailto:matt@matthicks.com" target="_blank">matt@matthicks.com</a>&gt; wrote:<br>
&gt; I&#39;ve looked at DeflatingStreamSinkConduit, but am at a loss to figure out<br>
&gt; how to adapt this to streaming a zip file.  Is there any other information<br>
&gt; you could give me?<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; On Thu, Aug 31, 2017 at 11:46 PM Stuart Douglas &lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; You could potentially adapt<br>
&gt;&gt; io.undertow.conduits.DeflatingStreamSinkConduit, which uses a<br>
&gt;&gt; java.util.zip.Deflater.<br>
&gt;&gt;<br>
&gt;&gt; Stuart<br>
&gt;&gt;<br>
&gt;&gt; On Fri, Sep 1, 2017 at 5:57 AM, Hicks, Matt &lt;<a href="mailto:matt@matthicks.com" target="_blank">matt@matthicks.com</a>&gt; wrote:<br>
&gt;&gt; &gt; I&#39;m trying to create ZIP files on-demand from the server and stream them<br>
&gt;&gt; &gt; back to the browser, but I&#39;m not sure the proper way to do this.  The<br>
&gt;&gt; &gt; only<br>
&gt;&gt; &gt; way I can think of is to use a `ZipOutputStream`, but that would be a<br>
&gt;&gt; &gt; blocking operation.  Is there a better way to do this?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; undertow-dev mailing list<br>
&gt;&gt; &gt; <a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
&gt;&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br>
</blockquote></div>