code: public DecodingState decode(IoBuffer in, ProtocolDecoderOutput out)
              throws Exception {
          if (buffer == null) {
              buffer = IoBuffer.allocate(256).setAutoExpand(true);
          }
  
          if (buffer.position() + in.remaining() > maxLength) {
              throw new ProtocolDecoderException("Received data exceeds " + maxLength + " byte(s).");
          }
          buffer.put(in);
          return this;
      }
docs: {@inheritDoc}