@Override
	protected Object encode(ChannelHandlerContext ctc, Channel channel,
			Object msg) throws Exception {
		if (!(msg instanceof Message)) {
			return null;
		}
		byte[] data = ((Message) msg).toBytes();
		ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
		buf.writeBytes(data); // data
		return buf;
	}