for Java 8, BufferedReader has a file stream and the iterator which you can use in tandem with RxJava. https://dzone.com/articles/java-8-stream-rx-java
you can get a Flowable using the following code
Flowable.fromIterable(bufferedReader.lines()::iterator)
I use Flowable and Single to be more concise, it'll still work with Observable.
the code snippet is an example of how I read each single line from the buffered reader.
try (
FileReader fr = new FileReader("./folder1/source.txt");
BufferedReader br = new BufferedReader(fr);
//e.g. i write the output into this file
FileWriter fw = new FileWriter("./folder1/destination.txt");
BufferedWriter bw = new BufferedWriter(fw)
) {
//=========================================
//calling br.lines() gives you the stream.
//br.lines()::iterator returns you the iterable
//=========================================
Flowable.fromIterable(br.lines()::iterator)
//at this point you can do what you want for each line
//e.g. I split long strings into smaller Flowable<String> chunks.
.flatMap(i -> splitLine(i))
//e.g. I then use the output to query an external server with retrofit.
// which returns me a Single<String> result
.flatMapSingle(i -> handlePinyin(pr, i))
.subscribe(
//I save the results from server to destination.txt
py -> appendToFile(bw, py),
//print and quit if error
err -> print("ERROR " + err),
() -> print("Completed!"));
}catch (IOException e) {
print("Error " + e);
}