public static ByteBuffer serializeMetadataContentV2(int chunkSize, long totalSize, List<StoreKey> keys) {
    int bufSize =
        MessageFormatRecord.Metadata_Content_Format_V2.getMetadataContentSize(keys.get(0).sizeInBytes(), keys.size());
    ByteBuffer outputBuf = ByteBuffer.allocate(bufSize);
    MessageFormatRecord.Metadata_Content_Format_V2.serializeMetadataContentRecord(outputBuf, chunkSize, totalSize,
        keys);
    return outputBuf;
  }
Serialize the input list of keys that form the metadata content.
@param chunkSize the size of the intermediate data chunks for the object this metadata describes.
@param totalSize the total size of the object this metadata describes.
@param keys the input list of keys that form the metadata content.
@return a ByteBuffer containing the serialized output.
ambry-messageformat/src/main/java/com/github/ambry/messageformat/MetadataContentSerDe.java