Encoder for binary protocol

xtremed dipanjan.deb at gmail.com
Sat Jul 24 10:33:07 EDT 2010


Hi all,

We are trying to switch to Netty with an existing application. It has a
binary protocol with first byte as a message code followed by total message
length as 4 bytes integer and then a 4 byte integer op code followed by a
combination of integer and counted strings. In the application, we already
have the properly assembled message in a StringBuffer and need the Encoder
at the outgoing end only to pass on the message. On the incoming end we plan
to use LengthFieldBasedFrameDecoder and an appropriate decoder plus handler.

Our problem is that at the outgoing end in the Encoder, we are unable to
find a proper and efficient way of moving the message in the StringBiuffer
to ChannelBuffer from where it will get written out.

Can any one help? Are there any example showing similar usage?

Thanks in advance.

Deb.
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Encoder-for-binary-protocol-tp5332889p5332889.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list