add variation of Stream.iterate() that's finite

XMLWordPrintable

      Stream.iterate() and Stream.generate() are factories for infinite streams. It would be nice if there were a similar stream factory methods that could return finite streams.

      We are also considering something like Stream.takeWhile() -- see JDK-8071597 -- but this will terminate a stream based on a predicate on the stream value itself, not on some changed state of the stream source (e.g., reaching EOF).

            Assignee:
            Tagir Valeev
            Reporter:
            Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: