Appending an incoming ChannelBuffer?
greymeister
greymeister at gmail.com
Sat Jan 15 13:24:18 EST 2011
For a file streaming protocol that a project I'm working on requires, I need
to append the contents of the ChannelBuffer coming from a MessageEvent so
that on the disconnect event I can dump the contents into a file. Looking
at the ChannelBuffer and ChannelBuffers classes from the JavaDocs, I had
problems determining which method I should be using. I've tried several
including keeping a ByteArrayOutputStream and a ChannelBuffer to write into.
What seemed to end up working best was assigning
ChannelBuffers.copiedBuffer() to an instance variable and passing the
current instance variable and the one coming in from the MessageEvent. This
obviously wastes heap but works very quickly, whereas the other methods I
tried did not. What's the appropriate method to be called here to simply
append the contents from one ChannelBuffer to another?
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Appending-an-incoming-ChannelBuffer-tp5925199p5925199.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list