List of utility methods to do Stream of
Stream | streamOrEmpty(Iterable stream Or Empty return iterable != null ? StreamSupport.stream(iterable.spliterator(), false) : Stream.empty();
|
Stream | streamScanner(Scanner scanner) stream Scanner return StreamSupport
.stream(Spliterators.spliteratorUnknownSize(scanner, Spliterator.ORDERED | Spliterator.NONNULL),
false)
.onClose(scanner::close);
|
ArrayList | streamToList(Stream stream To List return (ArrayList<T>) stream.collect(Collectors.toList());
|
Stream | toParallelStream(Iterator to Parallel Stream Spliterator<T> spliter = Spliterators.spliteratorUnknownSize(iter, Spliterator.NONNULL);
return StreamSupport.stream(spliter, true);
|
Stream | toStream(Collection to Stream if (collection == null) { return Stream.empty(); } else { return collection.stream(); |
Stream | toStream(Enumeration Transform an Enumeration to a Stream return StreamSupport.stream(Spliterators.spliteratorUnknownSize(new Iterator<T>() { public T next() { return e.nextElement(); public boolean hasNext() { return e.hasMoreElements(); }, Spliterator.ORDERED), false); ... |
Stream | toStream(final Iterable to Stream return toList(iterable).stream();
|
Stream | toStream(final Iterable iterable) to Stream return toStream(iterable.iterator());
|
Stream | toStream(final T source) to Stream return Stream.of(source);
|
Stream | toStream(Iterable Converts an iterable into a stream. return StreamSupport.stream(iterable.spliterator(), false);
|