boolean deserializeUserMetadataAndBlob(InputStream streamlog, InputStream oldStreamlog, boolean isDeleted)
      throws ContinueException {
    boolean caughtException = false;
    boolean caughtExceptionInOld = false;
    ByteBuffer usermetadata = null;
    ByteBuffer oldUsermetadata = null;
    BlobData blobData = null;
    BlobData oldBlobData = null;

    try {
      usermetadata = MessageFormatRecord.deserializeUserMetadata(streamlog);
      blobData = MessageFormatRecord.deserializeBlob(streamlog);
    } catch (MessageFormatException e) {
      caughtException = true;
    } catch (IOException e) {
      caughtException = true;
    }

    try {
      oldUsermetadata = MessageFormatRecord.deserializeUserMetadata(oldStreamlog);
      oldBlobData = MessageFormatRecord.deserializeBlob(oldStreamlog);
    } catch (MessageFormatException e) {
      caughtExceptionInOld = true;
    } catch (IOException e) {
      caughtExceptionInOld = true;
    }

    boolean asExpected;

    if (!caughtException) {
      if (isDeleted) {
        ByteBuf byteBuf = blobData.content();
        try {
          asExpected = verifyZeroed(usermetadata.array()) && verifyZeroed(
              Utils.readBytesFromByteBuf(byteBuf, new byte[(int) blobData.getSize()], 0, (int) blobData.getSize()));
        } catch (IOException e) {
          asExpected = false;
        } finally {
          byteBuf.release();
        }
      } else {
        ByteBuf byteBuf = blobData.content();
        ByteBuf oldByteBuf = oldBlobData.content();
        try {
          asExpected = Arrays.equals(usermetadata.array(), oldUsermetadata.array()) && Arrays.equals(
              Utils.readBytesFromByteBuf(byteBuf, new byte[(int) blobData.getSize()], 0, (int) blobData.getSize()),
              Utils.readBytesFromByteBuf(oldByteBuf, new byte[(int) oldBlobData.getSize()], 0,
                  (int) oldBlobData.getSize()));
        } catch (IOException e) {
          asExpected = false;
        } finally {
          byteBuf.release();
          oldByteBuf.release();
        }
      }
      return asExpected;
    } else if (!caughtExceptionInOld) {
      if (isDeleted) {
        corruptDeleted++;
      } else {
        corruptNonDeleted++;
      }
      throw new ContinueException("records did not deserialize");
    } else {
      throw new ContinueException("records did not deserialize in either.");
    }
  }
@return {@code true} if this was a delete record, {@code false} otherwise
@throws ContinueException if there is a deser failure in the new log
ambry-tools/src/main/java/com/github/ambry/store/HardDeleteVerifier.java