code: @Override
      public DecodingState finishDecode(ProtocolDecoderOutput out)
              throws Exception {
          IoBuffer product;
          // When input contained only terminator rather than actual data...
          if (buffer == null) {
              product = (IoBuffer) allocator.wrap(allocator.allocate(0));
          } else {
              product = buffer.flip();
              buffer = null;
          }
          return finishDecode(product, out);
      }
docs: {@inheritDoc}