My learning diary

Iterator to Stream

With Google Guava, you can transform an Iterator into a Stream with But that API is only available from Guava 21. If you don’t want to use Guava or if your Guava version is below 21, you need an additional step to convert your Iterator to a Stream: Stream<String> stream = Spliterators.spliteratorUnknownSize( iterator, Spliterator.ORDERED ), false ); Reference: mkyong.

Continue reading "Iterator to Stream"