public static CompositeBlobInfo deserializeMetadataContentRecord(ByteBuffer buf, StoreKeyFactory storeKeyFactory)
      throws IOException, MessageFormatException {
    int version = buf.getShort();
    switch (version) {
      case MessageFormatRecord.Metadata_Content_Version_V2:
        return MessageFormatRecord.Metadata_Content_Format_V2.deserializeMetadataContentRecord(
            new DataInputStream(new ByteBufferInputStream(buf)), storeKeyFactory);
      case MessageFormatRecord.Metadata_Content_Version_V3:
        return MessageFormatRecord.Metadata_Content_Format_V3.deserializeMetadataContentRecord(
            new DataInputStream(new ByteBufferInputStream(buf)), storeKeyFactory);
      default:
        throw new MessageFormatException("Unknown version encountered for MetadataContent: " + version,
            MessageFormatErrorCodes.UnknownFormatVersion);
    }
  }
Deserialize the serialized metadata content in the input ByteBuffer using the given {@link StoreKeyFactory} as a
reference.
@param buf ByteBuffer containing the serialized metadata content.
@param storeKeyFactory the {@link StoreKeyFactory} to use to deserialize the content.
@return a list of {@link StoreKey} containing the deserialized output.
@throws IOException if an IOException is encountered during deserialization.
@throws MessageFormatException if an unknown version is encountered in the header of the serialized input.
ambry-messageformat/src/main/java/com/github/ambry/messageformat/MetadataContentSerDe.java