IntStream spliterator() example

Description

IntStream spliterator() returns the Spliterator for IntStream.

Syntax

spliterator has the following syntax.


Spliterator.OfInt spliterator()

Example

The following example shows how to use spliterator.


import java.util.Spliterator;
import java.util.stream.IntStream;
//w w w . j  a v a 2s  .co  m
public class Main {
  public static void main(String[] args) {
    IntStream i = IntStream.of(1,2,3,4,5,6,7);
    Spliterator.OfInt o =  i.spliterator();
    System.out.println(o.characteristics());  
  }
}

The code above generates the following result.





















Home »
  Java Streams »
    Reference »




Collectors
DoubleStream
DoubleStream.Builder
IntStream
IntStream.Builder
LongStream
LongStream.Builder
Stream
Stream.Builder