static UpdateRecord deserialize(CrcInputStream crcStream) throws IOException, MessageFormatException {
      UpdateRecord updateRecord;
      DataInputStream dataStream = new DataInputStream(crcStream);
      short accountId = dataStream.readShort();
      short containerId = dataStream.readShort();
      long updateTimeInMs = dataStream.readLong();
      SubRecord.Type type = SubRecord.Type.values()[dataStream.readShort()];
      switch (type) {
        case DELETE:
          updateRecord = new UpdateRecord(accountId, containerId, updateTimeInMs, getDeleteSubRecord(dataStream));
          break;
        case TTL_UPDATE:
          updateRecord = new UpdateRecord(accountId, containerId, updateTimeInMs, getTtlUpdateSubRecord(dataStream));
          break;
        case UNDELETE:
          updateRecord = new UpdateRecord(accountId, containerId, updateTimeInMs, getUndeleteSubRecord(dataStream));
          break;
        default:
          throw new IllegalArgumentException("Unknown update record type: " + type);
      }
      long actualCRC = crcStream.getValue();
      long expectedCRC = dataStream.readLong();
      if (actualCRC != expectedCRC) {
        throw new MessageFormatException(
            "update record data is corrupt. Expected CRC: " + expectedCRC + ", Actual CRC: " + actualCRC,
            MessageFormatErrorCodes.DataCorrupt);
      }
      return updateRecord;
    }
@param crcStream the stream that contains the serialized form of an {@link UpdateRecord} of version 3.
@return the deserialized {@link UpdateRecord}
@throws IOException if there are problems reading from stream.
@throws MessageFormatException if the format of the message is unexpected.
ambry-messageformat/src/main/java/com/github/ambry/messageformat/MessageFormatRecord.java