private void writeContent(AsyncWritableChannel writeChannel, ReadIntoCallbackWrapper callbackWrapper,
      ByteBuffer content) {
    ContentWriteCallback writeCallback;
    if (content == null) {
      allContentReceived = true;
      writeCallback = new ContentWriteCallback(true, callbackWrapper);
      content = ByteBuffer.allocate(0);
    } else {
      writeCallback = new ContentWriteCallback(false, callbackWrapper);
      if (digest != null) {
        int savedPosition = content.position();
        digest.update(content);
        content.position(savedPosition);
      }
    }
    writeChannel.write(content, writeCallback);
  }
Writes the provided {@code content} to the given {@code writeChannel}.
@param writeChannel the {@link AsyncWritableChannel} to write the {@code content} to.
@param callbackWrapper the {@link ReadIntoCallbackWrapper} for the read operation.
@param content the piece of {@link ByteBuffer} that needs to be written to the {@code writeChannel}.
ambry-test-utils/src/main/java/com/github/ambry/rest/MockRestRequest.java