@Override
		protected Object decode (ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer)
				throws Exception {
			input.setBuffer(buffer.array(), buffer.readerIndex(), buffer.readableBytes());
			if (length == -1) {
				// Read length.
				if (buffer.readableBytes() < 4) return null;
				length = input.readInt();
				buffer.readerIndex(input.position());
			}
			if (buffer.readableBytes() < length) return null;
			length = -1;
			Object object = kryo.readClassAndObject(input);
			// Dumps out bytes for JMeter's TCP Sampler (BinaryTCPClientImpl classname):
			// System.out.println("--");
			// for (int i = buffer.readerIndex() - 4; i < input.position(); i++) {
			// String hex = Integer.toHexString(input.getBuffer()[i] & 0xff);
			// if (hex.length() == 1) hex = "0" + hex;
			// System.out.print(hex.toUpperCase());
			// }
			// System.out.println("\n--");
			buffer.readerIndex(input.position());
			return object;
		}