private void splitContent(byte[] contentBytes, int numChunks, List<HttpContent> httpContents,
      boolean useCopyForcingByteBuf) {
    int individualPartSize = contentBytes.length / numChunks;
    ByteBuf content;
    for (int addedContentCount = 0; addedContentCount < numChunks - 1; addedContentCount++) {
      if (useCopyForcingByteBuf) {
        content =
            CopyForcingByteBuf.wrappedBuffer(contentBytes, addedContentCount * individualPartSize, individualPartSize);
      } else {
        content = Unpooled.wrappedBuffer(contentBytes, addedContentCount * individualPartSize, individualPartSize);
      }
      httpContents.add(new DefaultHttpContent(content));
    }
    if (useCopyForcingByteBuf) {
      content =
          CopyForcingByteBuf.wrappedBuffer(contentBytes, (numChunks - 1) * individualPartSize, individualPartSize);
    } else {
      content = Unpooled.wrappedBuffer(contentBytes, (numChunks - 1) * individualPartSize, individualPartSize);
    }
    httpContents.add(new DefaultLastHttpContent(content));
  }
Splits the given {@code contentBytes} into {@code numChunks} chunks and stores them in {@code httpContents}.
@param contentBytes the content that needs to be split.
@param numChunks the number of chunks to split {@code contentBytes} into.
@param httpContents the {@link List<HttpContent>} that will contain all the content in parts.
@param useCopyForcingByteBuf if {@code true}, uses {@link CopyForcingByteBuf} instead of the default
                             {@link ByteBuf}.
ambry-rest/src/test/java/com/github/ambry/rest/NettyRequestTest.java