public static ByteBuffer deserializeUserMetadataRecord(CrcInputStream crcStream)
        throws IOException, MessageFormatException {
      DataInputStream dataStream = new DataInputStream(crcStream);
      int usermetadataSize = dataStream.readInt();
      byte[] userMetadaBuffer = Utils.readBytesFromStream(dataStream, usermetadataSize);
      long actualCRC = crcStream.getValue();
      long expectedCRC = dataStream.readLong();
      if (actualCRC != expectedCRC) {
        logger.error("corrupt data while parsing user metadata Expected CRC {} Actual CRC {}", expectedCRC, actualCRC);
        throw new MessageFormatException("User metadata is corrupt", MessageFormatErrorCodes.DataCorrupt);
      }
      return ByteBuffer.wrap(userMetadaBuffer);
    }
- - - - - - - - - - - - - - - - - - - - - - - -
|         |           |            |            |
| version |   size    |  content   |     Crc    |
|(2 bytes)| (4 bytes) |  (n bytes) |  (8 bytes) |
|         |           |            |            |
 - - - - - - - - - - - - - - - - - - - - - - - -
 version    - The version of the user metadata record

 size       - The size of the user metadata content

 content    - The actual content that represents the user metadata

 crc        - The crc of the user metadata record
ambry-messageformat/src/main/java/com/github/ambry/messageformat/MessageFormatRecord.java