private DataInputStream getSerializedStream(BlobReadOptions readOptions, short version) {
    byte[] bytes;
    switch (version) {
      case BlobReadOptions.VERSION_0:
        // version length + offset length + size length + expires at length + key size
        bytes = new byte[2 + 8 + 8 + 8 + readOptions.getMessageInfo().getStoreKey().sizeInBytes()];
        ByteBuffer bufWrap = ByteBuffer.wrap(bytes);
        bufWrap.putShort(BlobReadOptions.VERSION_0);
        bufWrap.putLong(readOptions.getOffset());
        bufWrap.putLong(readOptions.getMessageInfo().getSize());
        bufWrap.putLong(readOptions.getMessageInfo().getExpirationTimeInMs());
        bufWrap.put(readOptions.getMessageInfo().getStoreKey().toBytes());
      case BlobReadOptions.VERSION_1:
        bytes = readOptions.toBytes();
        break;
      default:
        throw new IllegalArgumentException("Version " + version + " of BlobReadOptions does not exist");
    }
    return new DataInputStream(new ByteBufferInputStream(ByteBuffer.wrap(bytes)));
  }
Gets a serialized format of {@code readOptions} in the version {@code version}.
@param readOptions the {@link BlobReadOptions} to serialize.
@param version the version to serialize it in.
@return a serialized format of {@code readOptions} in the version {@code version}.
ambry-store/src/test/java/com/github/ambry/store/StoreMessageReadSetTest.java