code: @Override
      public DecodingState finishDecode(ProtocolDecoderOutput out)
              throws Exception {
          IoBufferEx readData;
          if (buffer == null) {
              readData = allocator.wrap(allocator.allocate(0));
          } else {
              buffer.flip();
              readData = buffer;
              buffer = null;
          }
          return finishDecode((IoBuffer) readData, out);
      }
docs: {@inheritDoc}