byte[] toBytes() throws IOException {
      ByteArrayOutputStream outStream = new ByteArrayOutputStream();
      DataOutputStream dataOutputStream = new DataOutputStream(outStream);

      /* Write the number of entries */
      dataOutputStream.writeInt(items.size());

      /* Write all the blobReadOptions */
      for (HardDeletePersistItem item : items) {
        dataOutputStream.write(item.blobReadOptions.toBytes());
      }

      /* Write all the messageStoreRecoveryInfos */
      for (HardDeletePersistItem item : items) {
        /* First write the size of the recoveryInfo */
        dataOutputStream.writeInt(item.messagesStoreRecoveryInfo.length);

        /* Now, write the recoveryInfo */
        dataOutputStream.write(item.messagesStoreRecoveryInfo);
      }

      return outStream.toByteArray();
    }
@return A serialized byte array containing the information required for hard delete recovery.
ambry-store/src/main/java/com/github/ambry/store/HardDeleter.java