Here you can find the source of toParallelStream(Iterator
public static <T> Stream<T> toParallelStream(Iterator<T> iter)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; import java.util.Spliterator; import java.util.Spliterators; import java.util.stream.Stream; import java.util.stream.StreamSupport; public class Main { public static <T> Stream<T> toParallelStream(Iterator<T> iter) { Spliterator<T> spliter = Spliterators.spliteratorUnknownSize(iter, Spliterator.NONNULL); return StreamSupport.stream(spliter, true); }// w w w . ja v a 2 s . c o m }