Class StreamUtils

    • Method Detail

      • iteratorToStream

        public static <T> Stream<T> iteratorToStream​(Iterator<T> iterator)
        Convert an Iterator to a Stream
        Type Parameters:
        T - the type of the Stream
        Parameters:
        iterator - the iterator
        Returns:
        the stream
      • iteratorToStream

        public static <T> Stream<T> iteratorToStream​(Iterator<T> iterator,
                                                     Boolean parallel)
        Convert an Iterator to a Stream
        Type Parameters:
        T - the type of the Stream
        Parameters:
        iterator - the iterator
        parallel - whether to parallelize the stream
        Returns:
        the stream