Recommended way of decoding non-framed messages?

tsuna tsunanet at gmail.com
Tue Aug 3 18:35:18 EDT 2010


On Sat, Jul 31, 2010 at 8:25 AM, Bruno de Carvalho <kindernade at gmail.com> wrote:
> Take a look at ReplayingDecoder

Is there a reason why ReplayingDecoderBuffer (which is used under the
hood by ReplayingDecoder) doesn't support the array() method?  It
throws an UnsupportedOperationException (not an
UnreplayableOperationException).  I use it in a number of places when
I find seemingly invalid data in the RPCs I'm decoding as a way to
dump the contents of the ChannelBuffer, which helps a lot for
debugging and postmortem analysis.  I realize that ChannelBuffer#array
is supposed to return its own internal array (not a copy), and someone
changing the contents of the array would be non-replay-friendly.  But
then I think it's just up to the user to understand this when using
ReplayingDecoder anyway.
Unless there's a reason I'm not seeing, I'll file a bug and provide a
patch to implement this method.

-- 
Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com


More information about the netty-users mailing list