Lazy convert Iterable <T> to Stream <T> in Java 8?

I am looking for a way to convert Iterable to a stream in a lazy way in Java 8. Does anyone know a good way to do this Java 8?

I have tried so far:

StreamSupport.stream(myIterable.spliterator(), false);

Is this the best way to do this?

+4
source share

Source: https://habr.com/ru/post/1535494/


All Articles