public static void serializeMetadataContentRecord(ByteBuffer outputBuffer, long totalSize,
        List<Pair<StoreKey, Long>> keysAndContentSizes) {
      int keySize = keysAndContentSizes.get(0).getFirst().sizeInBytes();
      outputBuffer.putShort(Metadata_Content_Version_V3);
      outputBuffer.putLong(totalSize);
      outputBuffer.putInt(keysAndContentSizes.size());
      long sum = 0;
      for (Pair<StoreKey, Long> keyAndContentSize : keysAndContentSizes) {
        if (keyAndContentSize.getFirst().sizeInBytes() != keySize) {
          throw new IllegalArgumentException("Keys are not of same size");
        }
        outputBuffer.putLong(keyAndContentSize.getSecond());
        outputBuffer.put(keyAndContentSize.getFirst().toBytes());
        sum += keyAndContentSize.getSecond();
      }
      if (sum != totalSize) {
        throw new IllegalArgumentException("Key content sizes do not equal total size");
      }
    }
Serialize a metadata content record.
@param outputBuffer output buffer of the serialized metadata content
@param totalSize total size of the blob data content
@param keysAndContentSizes list of data blob keys referenced by the metadata
                           blob along with the data content sizes of each data blob
ambry-messageformat/src/main/java/com/github/ambry/messageformat/MessageFormatRecord.java