Reading bytes from ChannelBuffer, writing with RandomAccessFile

Michael McGrady mmcgrady at topiatechnology.com
Fri Sep 11 13:11:15 EDT 2009


I am happy with the performance I get from using the NIO stream chunks  
in the KarmaDecoder that is in the archives.  There have been updates  
to this in the archives with significant improvements so be sure to  
look at the latest.  Eventually I will provide the whole app.

Mike


On Sep 11, 2009, at 9:15 AM, bgoetzmann wrote:

>
> Hello,
>
> In my custom handler's messageReceived, I would like write bytes  
> contained
> in the ChannelBuffer instance into a file using a RandomAccessFile  
> instance;
> so, a simple approach could be (where raf is the RandomAccessFile
> reference):
>
> ChannelBuffer buf = (ChannelBuffer) e.getMessage();
> while(buf.readable()) {
>    raf.writeByte(buf.readByte());
> }
>
> It works, but I think there is a more quick approach! Any idea?
>
> Thank you.
>
> Bertrand.
> -- 
> View this message in context: http://n2.nabble.com/Reading-bytes-from-ChannelBuffer-writing-with-RandomAccessFile-tp3626803p3626803.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users

Mike McGrady
Principal Investigator AF081-028 AFRL SBIR
Senior Engineer
Topia Technology, Inc
1.253.720.3365
mmcgrady at topiatechnology.com









More information about the netty-users mailing list