Reactive Programming

File Reading in Reactor

File reading, line by line in Java… It’s never been a breeze, and until Java 8 the only high level option you had was to read the lines into a List<String> 😓

Then Java 8 came along, with its Stream interface, and a Files.lines(Path) method that returns a Stream<String>. Turns out, this stream will lazily read the lines from the file, without ever having to hold the whole content of the file in memory 😍

Let’s see how we can use that with Reactor!