public Object decode(ChannelHandlerContext ctx, Channel channel, Object obj)
throws Exception {
if (obj instanceof ChannelBuffer) {
ChannelBuffer buffer = (ChannelBuffer) obj;
if (buffer.readableBytes() > 8) {
String version = buffer.toString(buffer.readerIndex(), 4, Charset.defaultCharset());
if (version.equals("RPC0")) {
Adler32 adler32 = new Adler32();
adler32.update(buffer.array(),
buffer.arrayOffset() + buffer.readerIndex(),
buffer.readableBytes() - 4);