code: public void setData(IoBuffer buffer) {
          if (noCopy) {
              log.trace("Using buffer reference");
              this.data = buffer;
          } else {
              // try the backing array first if it exists
              if (buffer.hasArray()) {
                  log.trace("Buffer has backing array, making a copy");
                  byte[] copy = new byte[buffer.limit()];
                  buffer.mark();
                  buffer.get(copy);
                  buffer.reset();
                  data = IoBuffer.wrap(copy);
              } else {
                  log.trace("Buffer has no backing array, using ByteBuffer");
                  // fallback to ByteBuffer
                  data.put(buffer.buf()).flip();
              }
          }
      }
docs: Setter for data
  
  @param buffer
  Packet data