Streaming to file
Hoyt, David
hoyt6 at llnl.gov
Sat Nov 7 05:07:02 EST 2009
Thanks Trustin,
That improved the performance a bit. (c: If you get the chance, please take a look at my wget vs. netty message. I could really use some help...
-----Original Message-----
From: netty-users-bounces at lists.jboss.org [mailto:netty-users-bounces at lists.jboss.org] On Behalf Of Trustin Lee (???)
Sent: Friday, November 06, 2009 11:36 PM
To: Netty Users
Subject: Re: Streaming to file
Hi David,
ChannelBuffer.getBytes(int index, GatheringByteChannel out, int length)
ChannelBuffer.getBytes(int index, OutputStream out, int length)
ChannelBuffer.readBytes(GatheringByteChannel out, int length)
ChannelBuffer.readBytes(OutputStream out, int length)
are what you are looking for. :)
— Trustin Lee, http://*gleamynode.net/
On Sat, Nov 7, 2009 at 1:57 AM, Hoyt, David <hoyt6 at llnl.gov> wrote:
> What’s the best way to get a ChannelBuffer into a file? I just want to dump
> the incoming bytes into a file.
>
> I’m using NIO and I have a FileChannel and I’m just calling
> "myFileChannel.write(myChannelBuffer.toByteBuffer());
> myFileChannel.flush();" – is that right? Is there a better way?
>
> Is there a way to have my incoming ChannelBuffers automagically be a
> ByteBuffer without having additional overhead of calling .toByteBuffer() and
> risking byte copying?
>
> Thanks,
> - David Hoyt
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://*lists.jboss.org/mailman/listinfo/netty-users
>
>
_______________________________________________
netty-users mailing list
netty-users at lists.jboss.org
https://*lists.jboss.org/mailman/listinfo/netty-users
More information about the netty-users
mailing list