List of utility methods to do Stream of
Stream | toStream(Iterator to Stream return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iter, Spliterator.ORDERED), parallel);
|
Stream | toStream(Optional No longer needed in Java 9 where Optional if (value.isPresent()) { return Stream.of(value.get()); } else { return Stream.empty(); |
Stream | toStream(T[] array, boolean parallel) to Stream return StreamSupport.stream(Arrays.spliterator(array), parallel);
|
Stream | toStreamLine(final Scanner scanner) to Stream Line Objects.requireNonNull(scanner); final Iterator<String> iter = new Iterator<String>() { final Scanner s = scanner; @Override public boolean hasNext() { return s.hasNextLine(); @Override ... |
Stream | toStreamNumber(final Scanner scanner) to Stream Number Objects.requireNonNull(scanner); final Iterator<Long> iter = new Iterator<Long>() { final Scanner s = scanner; @Override public boolean hasNext() { boolean hasNumber = false; while (s.hasNext()) { hasNumber = s.hasNextLong(); ... |