public static BlobData deserializeBlobRecord(CrcInputStream crcStream) throws IOException, MessageFormatException {
      DataInputStream dataStream = new DataInputStream(crcStream);
      // Get the BlobType.
      short blobTypeOrdinal = dataStream.readShort();
      if (blobTypeOrdinal >= BlobType.values().length) {
        logger.error("corrupt data while parsing blob content BlobContentType {}", blobTypeOrdinal);
        throw new MessageFormatException("corrupt data while parsing blob content",
            MessageFormatErrorCodes.DataCorrupt);
      }
      BlobType blobContentType = BlobType.values()[blobTypeOrdinal];

      // Get whether the blob is compressed.
      boolean isCompressed = dataStream.readByte() == 1;

      // Get the blob binary.
      long dataSize = dataStream.readLong();
      if (dataSize > Integer.MAX_VALUE) {
        throw new IOException("We only support data of max size == MAX_INT. Error while reading blob from store");
      }
      ByteBuf byteBuf = null;
      try {
        byteBuf = Utils.readNettyByteBufFromCrcInputStream(crcStream, (int) dataSize);
      } catch (RuntimeException e) {
        logger.error("Failed to read ByteBuf from crc input stream with size: {}", dataSize);
        throw e;
      }
      long crc = crcStream.getValue();
      long streamCrc = dataStream.readLong();
      if (crc != streamCrc) {
        logger.error("corrupt data while parsing blob content expectedcrc {} actualcrc {}", crc, streamCrc);
        throw new MessageFormatException("corrupt data while parsing blob content",
            MessageFormatErrorCodes.DataCorrupt);
      }

      return new BlobData(blobContentType, dataSize, byteBuf, isCompressed);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|         |           |              |            |            |            |
| version | blobType  | isCompressed |    size    |  content   |     Crc    |
|(2 bytes)| (2 bytes) | (1 byte)     |  (8 bytes) |  (n bytes) |  (8 bytes) |
|         |           |              |            |            |            |
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 version    - The version of the blob record

 blobType   - The type of the blob

 isCompressed - Whether the content is compressed.

 size       - The size of the blob content

 content    - The actual content that represents the blob

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