<div dir="ltr">Just to clarify this (and correct me if I am wrong here Trustin), if then, you are going to use that byte array in another thread (for example, using the execution handler), then you have to copy it over. For example, in your http request message handler which then delegates the handling of the Http request to another thread.<div>

<br></div><div>-shay.banon<br><br><div class="gmail_quote">On Wed, Mar 3, 2010 at 7:56 AM, &quot;Trustin Lee (이희승)&quot; <span dir="ltr">&lt;<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Adam,<br>
<br>
Netty 3.2 adds array() and hasArray() to ChannelBuffer.<br>
<br>
In 3.1, you can call toByteBuffer() which will not involve memory copy<br>
if possible.<br>
<br>
HTH,<br>
Trustin<br>
<div><div></div><div class="h5"><br>
Adam Durana wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m looking for the most efficient way to get a ChannelBuffer&#39;s data<br>
&gt; in the form of a byte array.  The byte array will be only read from<br>
&gt; and not modified.  Is the best way to use a ChannelBuffer&#39;s readBytes<br>
&gt; method to copy the data into an array?  Or is there a way that doesn&#39;t<br>
&gt; involve copying given that I&#39;m not going to be modifying the array?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Adam<br>
&gt; _______________________________________________<br>
&gt; netty-users mailing list<br>
&gt; <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
<br>
</div></div><font color="#888888">--<br>
what we call human nature in actuality is human habit<br>
<a href="http://gleamynode.net/" target="_blank">http://gleamynode.net/</a><br>
<br>
<br>
</font><br>_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br></blockquote></div><br></div></div>