Java 8 Stream utilities for input data
问题 Imagine having some sort of incoming data either by callback or an InputStream that you need to continuously convert into a Java 8 Stream . We don't know when the incoming data-stream stops, but we know that it can stop. So far I've seen two ways of getting around this problem and I'm interested in the best practices on how to achieve this. Mainly because I this must be something someone has faced before. There must be a simpler way of doing it than the ideas below. 1) The most simple way is