Reading bytes from ChannelBuffer, writing with RandomAccessFile

Bertrand Goetzmann bertrand.goetzmann at gmail.com
Sat Sep 12 04:40:26 EDT 2009


Thank you Michael,
I would appreciate to look at your whole application KarmaDecoder!

- Bertrand

2009/9/11 Michael McGrady <mmcgrady at topiatechnology.com>

> 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
>
>
>
>
>
>
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20090912/bc2d1b66/attachment.html 


More information about the netty-users mailing list