private void doSerDeTest(BlobReadOptions readOptions, LogSegment segment, Log log) throws IOException {
    for (short i = 0; i <= 1; i++) {
      DataInputStream stream = getSerializedStream(readOptions, i);
      BlobReadOptions deSerReadOptions = BlobReadOptions.fromBytes(stream, STORE_KEY_FACTORY, log);
      assertEquals("Ref count of log segment should have increased", 1, segment.refCount());
      verifyGetters(deSerReadOptions, segment, readOptions.getOffset(), false,
          new MessageInfo(readOptions.getMessageInfo().getStoreKey(), readOptions.getMessageInfo().getSize(),
              readOptions.getMessageInfo().getExpirationTimeInMs(), Account.UNKNOWN_ACCOUNT_ID,
              Container.UNKNOWN_CONTAINER_ID, Utils.Infinite_Time));
      deSerReadOptions.close();
      assertEquals("Ref count of log segment should have decreased", 0, segment.refCount());
    }
  }
Serializes {@code readOptions} in all formats and ensures that the {@link BlobReadOptions} obtained from the
deserialization matches the original.
@param readOptions the {@link BlobReadOptions} that has to be serialized/deserialized.
@param segment the {@link LogSegment} referred to by {@code readOptions}.
@param log the {@link Log} that {@code segment} is a part of.
@throws IOException
ambry-store/src/test/java/com/github/ambry/store/StoreMessageReadSetTest.java