public static <E> Stream<E> streamUntil(Supplier<? extends E> supplier, Predicate<? super E> stop) {

    Iterator<E> iterator = AltIterators.iterateUntil(supplier, stop);
    Spliterator<E> spliterator = Spliterators.spliterator(iterator, Long.MAX_VALUE, Spliterator.ORDERED);
    return StreamSupport.stream(spliterator, false);
  }
public static < E > Stream < E > streamUntil ( Supplier < ? extends E > supplier , Predicate < ? super E > stop ) { Iterator < E > iterator = AltIterators . iterateUntil ( supplier , stop ) ; Spliterator < E > spliterator = Spliterators . spliterator ( iterator , Long . MAX_VALUE , Spliterator . ORDERED ) ; return StreamSupport . stream ( spliterator , false ) ; }
Consumes data from the supplier until a condition is met.
Use this method where a "poison pill" can be supplied to stop processing.

@param supplier element source
@param stop stops invoking supplier when this returns true
@param <E> the element type
@return a new stream