code: public static <T extends Serializable> Flowable<T> read(final ObjectInputStream ois) {
          return Flowable.generate(new Consumer<Emitter<T>>() {
              @Override
              public void accept(Emitter<T> emitter) throws Exception {
                  try {
                      @SuppressWarnings("unchecked")
                      T t = (T) ois.readObject();
                      emitter.onNext(t);
                  } catch (EOFException e) {
                      emitter.onComplete();
                  } catch (ClassNotFoundException e) {
                      emitter.onError(e);
                  } catch (IOException e) {
                      emitter.onError(e);
                  }
              }
          });
      }
docs: Returns the deserialized objects from the given {@link InputStream} as a
  {@link Flowable} stream.
  
  @param ois
  the {@link ObjectInputStream}
  @param <T>
  the generic type of the returned stream
  @return the stream of deserialized objects from the {@link InputStream}
  as an {@link Flowable}.