public static void serializeMetadataContentRecord(ByteBuffer outputBuffer, int chunkSize, long totalSize,
        List<StoreKey> keys) {
      if (chunkSize <= 0 || ((totalSize + chunkSize - 1) / chunkSize) != keys.size()) {
        throw new IllegalArgumentException("Invalid totalSize or chunkSize");
      }
      int keySize = keys.get(0).sizeInBytes();
      outputBuffer.putShort(Metadata_Content_Version_V2);
      outputBuffer.putInt(chunkSize);
      outputBuffer.putLong(totalSize);
      for (StoreKey storeKey : keys) {
        if (storeKey.sizeInBytes() != keySize) {
          throw new IllegalArgumentException("Keys are not of same size");
        }
        outputBuffer.put(storeKey.toBytes());
      }
    }
Serialize a metadata content record.
@param outputBuffer The buffer to serialize into.
@param chunkSize The size of each data chunk except the last, which could possibly be smaller.
@param totalSize The total size of the object this metadata describes.
ambry-messageformat/src/main/java/com/github/ambry/messageformat/MessageFormatRecord.java