Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Loading files with backpressure – RxJava FAQ

Tags: stream turn

Processing file as a Stream turns out to be tremendously effective and convenient. Many people seem to forget that since Java 8 (3+ years!) we can very easily turn any file into a stream of lines: String filePath = "foobar.txt"; try (BufferedReader reader = new BufferedReader(new FileReader(filePath))) { reader.lines() .filter(line -> !line.startsWith("#")) .map(String::toLowerCase) .flatMap(line -> ...



This post first appeared on Java Code Geeks, please read the originial post: here

Share the post

Loading files with backpressure – RxJava FAQ

×

Subscribe to Java Code Geeks

Get updates delivered right to your inbox!

Thank you for your subscription

×