ChannelBuffer to byte array

"Trustin Lee (이희승)" trustin at gmail.com
Wed Mar 3 00:56:52 EST 2010


Adam,

Netty 3.2 adds array() and hasArray() to ChannelBuffer.

In 3.1, you can call toByteBuffer() which will not involve memory copy
if possible.

HTH,
Trustin

Adam Durana wrote:
> Hi,
> 
> I'm looking for the most efficient way to get a ChannelBuffer's data
> in the form of a byte array.  The byte array will be only read from
> and not modified.  Is the best way to use a ChannelBuffer's readBytes
> method to copy the data into an array?  Or is there a way that doesn't
> involve copying given that I'm not going to be modifying the array?
> 
> Thanks,
> Adam
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100303/38b93607/attachment.bin 


More information about the netty-users mailing list