@Override
  public Future<Long> write(ByteBuf src, Callback<Long> callback) {
    return writeInternal(() -> {
      ByteBuf duplicate = src.retainedDuplicate();
      // mark all bytes as read.
      src.skipBytes(src.readableBytes());
      return duplicate;
    }, callback);
  }
@inheritDoc

This method requires copying the buffer because {@link ByteBuffer}s do not have the concept of a reference count,
so the other side is free to reuse the buffer after the callback has been called (as opposed to when the ref count
reaches 0).
ambry-commons/src/main/java/com/github/ambry/commons/RetainingAsyncWritableChannel.java