public static IntStream intStream(Spliterator.OfInt spliterator, boolean parallel) {
        return new IntPipeline.Head<>(spliterator,
                                      StreamOpFlag.fromCharacteristics(spliterator),
                                      parallel);
    }
public static IntStream intStream ( Spliterator . OfInt spliterator , boolean parallel ) { return new IntPipeline . Head < > ( spliterator , StreamOpFlag . fromCharacteristics ( spliterator ) , parallel ) ; }
Creates a new sequential or parallel {@code IntStream} from a
{@code Spliterator.OfInt}.

<p>The spliterator is only traversed, split, or queried for estimated size
after the terminal operation of the stream pipeline commences.

<p>It is strongly recommended the spliterator report a characteristic of
{@code IMMUTABLE} or {@code CONCURRENT}, or be
<a href="../Spliterator.html#binding">late-binding</a>.  Otherwise,
{@link #intStream(java.util.function.Supplier, int, boolean)} should be
used to reduce the scope of potential interference with the source.  See
<a href="package-summary.html#NonInterference">Non-Interference</a> for
more details.

@param spliterator a {@code Spliterator.OfInt} describing the stream elements
@param parallel if {@code true} then the returned stream is a parallel
stream; if {@code false} the returned stream is a sequential
stream.
@return a new sequential or parallel {@code IntStream}