Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/java/util/Spliterators#nestedclasses) \| [Methods](https://developer.android.com/reference/java/util/Spliterators#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/util/Spliterators#inhmethods)

# Spliterators


`
public

final

class
Spliterators
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.util.Spliterators |

<br />

*** ** * ** ***

Static classes and methods for operating on or creating instances of
`https://developer.android.com/reference/java/util/Spliterator` and its primitive specializations
`https://developer.android.com/reference/java/util/Spliterator.OfInt`, `https://developer.android.com/reference/java/util/Spliterator.OfLong`, and
`https://developer.android.com/reference/java/util/Spliterator.OfDouble`.
**See also:**

- `https://developer.android.com/reference/java/util/Spliterator`

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/java/util/Spliterators.AbstractDoubleSpliterator` An abstract `Spliterator.OfDouble` that implements `trySplit` to permit limited parallelism. |
| ` class` | `https://developer.android.com/reference/java/util/Spliterators.AbstractIntSpliterator` An abstract `Spliterator.OfInt` that implements `trySplit` to permit limited parallelism. |
| ` class` | `https://developer.android.com/reference/java/util/Spliterators.AbstractLongSpliterator` An abstract `Spliterator.OfLong` that implements `trySplit` to permit limited parallelism. |
| ` class` | `https://developer.android.com/reference/java/util/Spliterators.AbstractSpliterator<T>` An abstract `Spliterator` that implements `trySplit` to permit limited parallelism. |

| ### Public methods ||
|---|---|
| ` static https://developer.android.com/reference/java/util/Spliterator.OfDouble` | ` https://developer.android.com/reference/java/util/Spliterators#emptyDoubleSpliterator()() ` Creates an empty `Spliterator.OfDouble` The empty spliterator reports `https://developer.android.com/reference/java/util/Spliterator#SIZED` and `https://developer.android.com/reference/java/util/Spliterator#SUBSIZED`. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfInt` | ` https://developer.android.com/reference/java/util/Spliterators#emptyIntSpliterator()() ` Creates an empty `Spliterator.OfInt` The empty spliterator reports `https://developer.android.com/reference/java/util/Spliterator#SIZED` and `https://developer.android.com/reference/java/util/Spliterator#SUBSIZED`. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfLong` | ` https://developer.android.com/reference/java/util/Spliterators#emptyLongSpliterator()() ` Creates an empty `Spliterator.OfLong` The empty spliterator reports `https://developer.android.com/reference/java/util/Spliterator#SIZED` and `https://developer.android.com/reference/java/util/Spliterator#SUBSIZED`. |
| ` static <T> https://developer.android.com/reference/java/util/Spliterator<T>` | ` https://developer.android.com/reference/java/util/Spliterators#emptySpliterator()() ` Creates an empty `Spliterator` The empty spliterator reports `https://developer.android.com/reference/java/util/Spliterator#SIZED` and `https://developer.android.com/reference/java/util/Spliterator#SUBSIZED`. |
| ` static https://developer.android.com/reference/java/util/PrimitiveIterator.OfDouble` | ` https://developer.android.com/reference/java/util/Spliterators#iterator(java.util.Spliterator.OfDouble)(https://developer.android.com/reference/java/util/Spliterator.OfDouble spliterator) ` Creates an `PrimitiveIterator.OfDouble` from a `Spliterator.OfDouble`. |
| ` static https://developer.android.com/reference/java/util/PrimitiveIterator.OfInt` | ` https://developer.android.com/reference/java/util/Spliterators#iterator(java.util.Spliterator.OfInt)(https://developer.android.com/reference/java/util/Spliterator.OfInt spliterator) ` Creates an `PrimitiveIterator.OfInt` from a `Spliterator.OfInt`. |
| ` static https://developer.android.com/reference/java/util/PrimitiveIterator.OfLong` | ` https://developer.android.com/reference/java/util/Spliterators#iterator(java.util.Spliterator.OfLong)(https://developer.android.com/reference/java/util/Spliterator.OfLong spliterator) ` Creates an `PrimitiveIterator.OfLong` from a `Spliterator.OfLong`. |
| ` static <T> https://developer.android.com/reference/java/util/Iterator<T>` | ` https://developer.android.com/reference/java/util/Spliterators#iterator(java.util.Spliterator<?%20extends%20T>)(https://developer.android.com/reference/java/util/Spliterator<? extends T> spliterator) ` Creates an `Iterator` from a `Spliterator`. |
| ` static <T> https://developer.android.com/reference/java/util/Spliterator<T>` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(java.util.Iterator<?%20extends%20T>,%20long,%20int)(https://developer.android.com/reference/java/util/Iterator<? extends T> iterator, long size, int characteristics) ` Creates a `Spliterator` using a given `Iterator` as the source of elements, and with a given initially reported size. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfLong` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(long[],%20int)(long[] array, int additionalCharacteristics) ` Creates a `Spliterator.OfLong` covering the elements of a given array, using a customized set of spliterator characteristics. |
| ` static <T> https://developer.android.com/reference/java/util/Spliterator<T>` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(java.lang.Object[],%20int,%20int,%20int)(https://developer.android.com/reference/java/lang/Object array, int fromIndex, int toIndex, int additionalCharacteristics) ` Creates a `Spliterator` covering a range of elements of a given array, using a customized set of spliterator characteristics. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfLong` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(long[],%20int,%20int,%20int)(long[] array, int fromIndex, int toIndex, int additionalCharacteristics) ` Creates a `Spliterator.OfLong` covering a range of elements of a given array, using a customized set of spliterator characteristics. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfLong` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(java.util.PrimitiveIterator.OfLong,%20long,%20int)(https://developer.android.com/reference/java/util/PrimitiveIterator.OfLong iterator, long size, int characteristics) ` Creates a `Spliterator.OfLong` using a given `LongStream.LongIterator` as the source of elements, and with a given initially reported size. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfDouble` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(java.util.PrimitiveIterator.OfDouble,%20long,%20int)(https://developer.android.com/reference/java/util/PrimitiveIterator.OfDouble iterator, long size, int characteristics) ` Creates a `Spliterator.OfDouble` using a given `DoubleStream.DoubleIterator` as the source of elements, and with a given initially reported size. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfDouble` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(double[],%20int)(double[] array, int additionalCharacteristics) ` Creates a `Spliterator.OfDouble` covering the elements of a given array, using a customized set of spliterator characteristics. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfInt` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(int[],%20int,%20int,%20int)(int[] array, int fromIndex, int toIndex, int additionalCharacteristics) ` Creates a `Spliterator.OfInt` covering a range of elements of a given array, using a customized set of spliterator characteristics. |
| ` static <T> https://developer.android.com/reference/java/util/Spliterator<T>` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(java.util.Collection<?%20extends%20T>,%20int)(https://developer.android.com/reference/java/util/Collection<? extends T> c, int characteristics) ` Creates a `Spliterator` using the given collection's `https://developer.android.com/reference/java/util/Collection#iterator()` as the source of elements, and reporting its `https://developer.android.com/reference/java/util/Collection#size()` as its initial size. |
| ` static <T> https://developer.android.com/reference/java/util/Spliterator<T>` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(java.lang.Object[],%20int)(https://developer.android.com/reference/java/lang/Object array, int additionalCharacteristics) ` Creates a `Spliterator` covering the elements of a given array, using a customized set of spliterator characteristics. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfInt` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(int[],%20int)(int[] array, int additionalCharacteristics) ` Creates a `Spliterator.OfInt` covering the elements of a given array, using a customized set of spliterator characteristics. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfDouble` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(double[],%20int,%20int,%20int)(double[] array, int fromIndex, int toIndex, int additionalCharacteristics) ` Creates a `Spliterator.OfDouble` covering a range of elements of a given array, using a customized set of spliterator characteristics. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfInt` | ` https://developer.android.com/reference/java/util/Spliterators#spliterator(java.util.PrimitiveIterator.OfInt,%20long,%20int)(https://developer.android.com/reference/java/util/PrimitiveIterator.OfInt iterator, long size, int characteristics) ` Creates a `Spliterator.OfInt` using a given `IntStream.IntIterator` as the source of elements, and with a given initially reported size. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfInt` | ` https://developer.android.com/reference/java/util/Spliterators#spliteratorUnknownSize(java.util.PrimitiveIterator.OfInt,%20int)(https://developer.android.com/reference/java/util/PrimitiveIterator.OfInt iterator, int characteristics) ` Creates a `Spliterator.OfInt` using a given `IntStream.IntIterator` as the source of elements, with no initial size estimate. |
| ` static <T> https://developer.android.com/reference/java/util/Spliterator<T>` | ` https://developer.android.com/reference/java/util/Spliterators#spliteratorUnknownSize(java.util.Iterator<?%20extends%20T>,%20int)(https://developer.android.com/reference/java/util/Iterator<? extends T> iterator, int characteristics) ` Creates a `Spliterator` using a given `Iterator` as the source of elements, with no initial size estimate. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfDouble` | ` https://developer.android.com/reference/java/util/Spliterators#spliteratorUnknownSize(java.util.PrimitiveIterator.OfDouble,%20int)(https://developer.android.com/reference/java/util/PrimitiveIterator.OfDouble iterator, int characteristics) ` Creates a `Spliterator.OfDouble` using a given `DoubleStream.DoubleIterator` as the source of elements, with no initial size estimate. |
| ` static https://developer.android.com/reference/java/util/Spliterator.OfLong` | ` https://developer.android.com/reference/java/util/Spliterators#spliteratorUnknownSize(java.util.PrimitiveIterator.OfLong,%20int)(https://developer.android.com/reference/java/util/PrimitiveIterator.OfLong iterator, int characteristics) ` Creates a `Spliterator.OfLong` using a given `LongStream.LongIterator` as the source of elements, with no initial size estimate. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public methods

### emptyDoubleSpliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfDouble emptyDoubleSpliterator ()
```

Creates an empty `Spliterator.OfDouble`

The empty spliterator reports `https://developer.android.com/reference/java/util/Spliterator#SIZED` and
`https://developer.android.com/reference/java/util/Spliterator#SUBSIZED`. Calls to
`https://developer.android.com/reference/java/util/Spliterator#trySplit()` always return `null`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfDouble` | An empty spliterator <br /> |

### emptyIntSpliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfInt emptyIntSpliterator ()
```

Creates an empty `Spliterator.OfInt`

The empty spliterator reports `https://developer.android.com/reference/java/util/Spliterator#SIZED` and
`https://developer.android.com/reference/java/util/Spliterator#SUBSIZED`. Calls to
`https://developer.android.com/reference/java/util/Spliterator#trySplit()` always return `null`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfInt` | An empty spliterator <br /> |

### emptyLongSpliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfLong emptyLongSpliterator ()
```

Creates an empty `Spliterator.OfLong`

The empty spliterator reports `https://developer.android.com/reference/java/util/Spliterator#SIZED` and
`https://developer.android.com/reference/java/util/Spliterator#SUBSIZED`. Calls to
`https://developer.android.com/reference/java/util/Spliterator#trySplit()` always return `null`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfLong` | An empty spliterator <br /> |

### emptySpliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator<T> emptySpliterator ()
```

Creates an empty `Spliterator`

The empty spliterator reports `https://developer.android.com/reference/java/util/Spliterator#SIZED` and
`https://developer.android.com/reference/java/util/Spliterator#SUBSIZED`. Calls to
`https://developer.android.com/reference/java/util/Spliterator#trySplit()` always return `null`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator<T>` | An empty spliterator <br /> |

### iterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static PrimitiveIterator.OfDouble iterator (Spliterator.OfDouble spliterator)
```

Creates an `PrimitiveIterator.OfDouble` from a
`Spliterator.OfDouble`.

Traversal of elements should be accomplished through the iterator.
The behaviour of traversal is undefined if the spliterator is operated
after the iterator is returned.

<br />

| Parameters ||
|---|---|
| `spliterator` | `Spliterator.OfDouble`: The spliterator <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/PrimitiveIterator.OfDouble` | An iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given spliterator is `null` |

### iterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static PrimitiveIterator.OfInt iterator (Spliterator.OfInt spliterator)
```

Creates an `PrimitiveIterator.OfInt` from a
`Spliterator.OfInt`.

Traversal of elements should be accomplished through the iterator.
The behaviour of traversal is undefined if the spliterator is operated
after the iterator is returned.

<br />

| Parameters ||
|---|---|
| `spliterator` | `Spliterator.OfInt`: The spliterator <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/PrimitiveIterator.OfInt` | An iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given spliterator is `null` |

### iterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static PrimitiveIterator.OfLong iterator (Spliterator.OfLong spliterator)
```

Creates an `PrimitiveIterator.OfLong` from a
`Spliterator.OfLong`.

Traversal of elements should be accomplished through the iterator.
The behaviour of traversal is undefined if the spliterator is operated
after the iterator is returned.

<br />

| Parameters ||
|---|---|
| `spliterator` | `Spliterator.OfLong`: The spliterator <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/PrimitiveIterator.OfLong` | An iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given spliterator is `null` |

### iterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Iterator<T> iterator (Spliterator<? extends T> spliterator)
```

Creates an `Iterator` from a `Spliterator`.

Traversal of elements should be accomplished through the iterator.
The behaviour of traversal is undefined if the spliterator is operated
after the iterator is returned.

<br />

| Parameters ||
|---|---|
| `spliterator` | `Spliterator`: The spliterator <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Iterator<T>` | An iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given spliterator is `null` |

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator<T> spliterator (Iterator<? extends T> iterator, 
                long size, 
                int characteristics)
```

Creates a `Spliterator` using a given `Iterator`
as the source of elements, and with a given initially reported size.

The spliterator is not
*[late-binding](https://developer.android.com/reference/java/util/Spliterator#binding)* , inherits
the *fail-fast* properties of the iterator, and implements
`trySplit` to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator.
The behaviour of splitting and traversal is undefined if the iterator is
operated on after the spliterator is returned, or the initially reported
size is not equal to the actual number of elements in the source.

<br />

| Parameters ||
|---|---|
| `iterator` | `Iterator`: The iterator for the source <br /> |
| `size` | `long`: The number of elements in the source, to be reported as initial `estimateSize` <br /> |
| `characteristics` | `int`: Characteristics of this spliterator's source or elements. The characteristics `SIZED` and `SUBSIZED` are additionally reported unless `CONCURRENT` is supplied. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator<T>` | A spliterator from an iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given iterator is `null` |

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfLong spliterator (long[] array, 
                int additionalCharacteristics)
```

Creates a `Spliterator.OfLong` covering the elements of a given array,
using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for
Spliterators which store portions of their elements in arrays, and need
fine control over Spliterator characteristics. Most other situations in
which a Spliterator for an array is needed should use
`https://developer.android.com/reference/java/util/Arrays#spliterator(long[])`.

The returned spliterator always reports the characteristics
`SIZED` and `SUBSIZED`. The caller may provide additional
characteristics for the spliterator to report; it is common to
additionally specify `IMMUTABLE` and `ORDERED`.

<br />

| Parameters ||
|---|---|
| `array` | `long`: The array, assumed to be unmodified during use <br /> |
| `additionalCharacteristics` | `int`: Additional spliterator characteristics of this spliterator's source or elements beyond `SIZED` and `SUBSIZED` which are always reported <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfLong` | A spliterator for an array <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given array is `null` |

**See also:**

- `https://developer.android.com/reference/java/util/Arrays#spliterator(long[])`

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator<T> spliterator (Object[] array, 
                int fromIndex, 
                int toIndex, 
                int additionalCharacteristics)
```

Creates a `Spliterator` covering a range of elements of a given
array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for
Spliterators which store portions of their elements in arrays, and need
fine control over Spliterator characteristics. Most other situations in
which a Spliterator for an array is needed should use
`https://developer.android.com/reference/java/util/Arrays#spliterator(T[])`.

The returned spliterator always reports the characteristics
`SIZED` and `SUBSIZED`. The caller may provide additional
characteristics for the spliterator to report; it is common to
additionally specify `IMMUTABLE` and `ORDERED`.

<br />

| Parameters ||
|---|---|
| `array` | `Object`: The array, assumed to be unmodified during use <br /> |
| `fromIndex` | `int`: The least index (inclusive) to cover <br /> |
| `toIndex` | `int`: One past the greatest index to cover <br /> |
| `additionalCharacteristics` | `int`: Additional spliterator characteristics of this spliterator's source or elements beyond `SIZED` and `SUBSIZED` which are always reported <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator<T>` | A spliterator for an array <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException` | if `fromIndex` is negative, `toIndex` is less than `fromIndex`, or `toIndex` is greater than the array size |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given array is `null` |

**See also:**

- `https://developer.android.com/reference/java/util/Arrays#spliterator(T[],%20int,%20int)`

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfLong spliterator (long[] array, 
                int fromIndex, 
                int toIndex, 
                int additionalCharacteristics)
```

Creates a `Spliterator.OfLong` covering a range of elements of a
given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for
Spliterators which store portions of their elements in arrays, and need
fine control over Spliterator characteristics. Most other situations in
which a Spliterator for an array is needed should use
`https://developer.android.com/reference/java/util/Arrays#spliterator(long[],%20int,%20int)`.

The returned spliterator always reports the characteristics
`SIZED` and `SUBSIZED`. The caller may provide additional
characteristics for the spliterator to report. (For example, if it is
known the array will not be further modified, specify `IMMUTABLE`;
if the array data is considered to have an encounter order, specify
`ORDERED`). The method `https://developer.android.com/reference/java/util/Arrays#spliterator(long[],%20int,%20int)` can
often be used instead, which returns a spliterator that reports
`SIZED`, `SUBSIZED`, `IMMUTABLE`, and `ORDERED`.

<br />

| Parameters ||
|---|---|
| `array` | `long`: The array, assumed to be unmodified during use <br /> |
| `fromIndex` | `int`: The least index (inclusive) to cover <br /> |
| `toIndex` | `int`: One past the greatest index to cover <br /> |
| `additionalCharacteristics` | `int`: Additional spliterator characteristics of this spliterator's source or elements beyond `SIZED` and `SUBSIZED` which are always reported <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfLong` | A spliterator for an array <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException` | if `fromIndex` is negative, `toIndex` is less than `fromIndex`, or `toIndex` is greater than the array size |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given array is `null` |

**See also:**

- `https://developer.android.com/reference/java/util/Arrays#spliterator(long[],%20int,%20int)`

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfLong spliterator (PrimitiveIterator.OfLong iterator, 
                long size, 
                int characteristics)
```

Creates a `Spliterator.OfLong` using a given
`LongStream.LongIterator` as the source of elements, and with a
given initially reported size.

The spliterator is not
*[late-binding](https://developer.android.com/reference/java/util/Spliterator#binding)* , inherits
the *fail-fast* properties of the iterator, and implements
`trySplit` to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator.
The behaviour of splitting and traversal is undefined if the iterator is
operated on after the spliterator is returned, or the initially reported
size is not equal to the actual number of elements in the source.

<br />

| Parameters ||
|---|---|
| `iterator` | `PrimitiveIterator.OfLong`: The iterator for the source <br /> |
| `size` | `long`: The number of elements in the source, to be reported as initial `estimateSize`. <br /> |
| `characteristics` | `int`: Characteristics of this spliterator's source or elements. The characteristics `SIZED` and `SUBSIZED` are additionally reported unless `CONCURRENT` is supplied. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfLong` | A spliterator from an iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given iterator is `null` |

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfDouble spliterator (PrimitiveIterator.OfDouble iterator, 
                long size, 
                int characteristics)
```

Creates a `Spliterator.OfDouble` using a given
`DoubleStream.DoubleIterator` as the source of elements, and with a
given initially reported size.

The spliterator is not
*[late-binding](https://developer.android.com/reference/java/util/Spliterator#binding)* , inherits
the *fail-fast* properties of the iterator, and implements
`trySplit` to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator.
The behaviour of splitting and traversal is undefined if the iterator is
operated on after the spliterator is returned, or the initially reported
size is not equal to the actual number of elements in the source.

<br />

| Parameters ||
|---|---|
| `iterator` | `PrimitiveIterator.OfDouble`: The iterator for the source <br /> |
| `size` | `long`: The number of elements in the source, to be reported as initial `estimateSize` <br /> |
| `characteristics` | `int`: Characteristics of this spliterator's source or elements. The characteristics `SIZED` and `SUBSIZED` are additionally reported unless `CONCURRENT` is supplied. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfDouble` | A spliterator from an iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given iterator is `null` |

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfDouble spliterator (double[] array, 
                int additionalCharacteristics)
```

Creates a `Spliterator.OfDouble` covering the elements of a given array,
using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for
Spliterators which store portions of their elements in arrays, and need
fine control over Spliterator characteristics. Most other situations in
which a Spliterator for an array is needed should use
`https://developer.android.com/reference/java/util/Arrays#spliterator(double[])`.

The returned spliterator always reports the characteristics
`SIZED` and `SUBSIZED`. The caller may provide additional
characteristics for the spliterator to report; it is common to
additionally specify `IMMUTABLE` and `ORDERED`.

<br />

| Parameters ||
|---|---|
| `array` | `double`: The array, assumed to be unmodified during use <br /> |
| `additionalCharacteristics` | `int`: Additional spliterator characteristics of this spliterator's source or elements beyond `SIZED` and `SUBSIZED` which are always reported <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfDouble` | A spliterator for an array <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given array is `null` |

**See also:**

- `https://developer.android.com/reference/java/util/Arrays#spliterator(double[])`

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfInt spliterator (int[] array, 
                int fromIndex, 
                int toIndex, 
                int additionalCharacteristics)
```

Creates a `Spliterator.OfInt` covering a range of elements of a
given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for
Spliterators which store portions of their elements in arrays, and need
fine control over Spliterator characteristics. Most other situations in
which a Spliterator for an array is needed should use
`https://developer.android.com/reference/java/util/Arrays#spliterator(int[],%20int,%20int)`.

The returned spliterator always reports the characteristics
`SIZED` and `SUBSIZED`. The caller may provide additional
characteristics for the spliterator to report; it is common to
additionally specify `IMMUTABLE` and `ORDERED`.

<br />

| Parameters ||
|---|---|
| `array` | `int`: The array, assumed to be unmodified during use <br /> |
| `fromIndex` | `int`: The least index (inclusive) to cover <br /> |
| `toIndex` | `int`: One past the greatest index to cover <br /> |
| `additionalCharacteristics` | `int`: Additional spliterator characteristics of this spliterator's source or elements beyond `SIZED` and `SUBSIZED` which are always reported <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfInt` | A spliterator for an array <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException` | if `fromIndex` is negative, `toIndex` is less than `fromIndex`, or `toIndex` is greater than the array size |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given array is `null` |

**See also:**

- `https://developer.android.com/reference/java/util/Arrays#spliterator(int[],%20int,%20int)`

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator<T> spliterator (Collection<? extends T> c, 
                int characteristics)
```

Creates a `Spliterator` using the given collection's
`https://developer.android.com/reference/java/util/Collection#iterator()` as the source of elements, and
reporting its `https://developer.android.com/reference/java/util/Collection#size()` as its initial size.

The spliterator is
*[late-binding](https://developer.android.com/reference/java/util/Spliterator#binding)* , inherits
the *fail-fast* properties of the collection's iterator, and
implements `trySplit` to permit limited parallelism.

<br />

| Parameters ||
|---|---|
| `c` | `Collection`: The collection <br /> |
| `characteristics` | `int`: Characteristics of this spliterator's source or elements. The characteristics `SIZED` and `SUBSIZED` are additionally reported unless `CONCURRENT` is supplied. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator<T>` | A spliterator from an iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given collection is `null` |

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator<T> spliterator (Object[] array, 
                int additionalCharacteristics)
```

Creates a `Spliterator` covering the elements of a given array,
using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for
Spliterators which store portions of their elements in arrays, and need
fine control over Spliterator characteristics. Most other situations in
which a Spliterator for an array is needed should use
`https://developer.android.com/reference/java/util/Arrays#spliterator(T[])`.

The returned spliterator always reports the characteristics
`SIZED` and `SUBSIZED`. The caller may provide additional
characteristics for the spliterator to report; it is common to
additionally specify `IMMUTABLE` and `ORDERED`.

<br />

| Parameters ||
|---|---|
| `array` | `Object`: The array, assumed to be unmodified during use <br /> |
| `additionalCharacteristics` | `int`: Additional spliterator characteristics of this spliterator's source or elements beyond `SIZED` and `SUBSIZED` which are always reported <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator<T>` | A spliterator for an array <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given array is `null` |

**See also:**

- `https://developer.android.com/reference/java/util/Arrays#spliterator(T[])`

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfInt spliterator (int[] array, 
                int additionalCharacteristics)
```

Creates a `Spliterator.OfInt` covering the elements of a given array,
using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for
Spliterators which store portions of their elements in arrays, and need
fine control over Spliterator characteristics. Most other situations in
which a Spliterator for an array is needed should use
`https://developer.android.com/reference/java/util/Arrays#spliterator(int[])`.

The returned spliterator always reports the characteristics
`SIZED` and `SUBSIZED`. The caller may provide additional
characteristics for the spliterator to report; it is common to
additionally specify `IMMUTABLE` and `ORDERED`.

<br />

| Parameters ||
|---|---|
| `array` | `int`: The array, assumed to be unmodified during use <br /> |
| `additionalCharacteristics` | `int`: Additional spliterator characteristics of this spliterator's source or elements beyond `SIZED` and `SUBSIZED` which are always reported <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfInt` | A spliterator for an array <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given array is `null` |

**See also:**

- `https://developer.android.com/reference/java/util/Arrays#spliterator(int[])`

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfDouble spliterator (double[] array, 
                int fromIndex, 
                int toIndex, 
                int additionalCharacteristics)
```

Creates a `Spliterator.OfDouble` covering a range of elements of a
given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for
Spliterators which store portions of their elements in arrays, and need
fine control over Spliterator characteristics. Most other situations in
which a Spliterator for an array is needed should use
`https://developer.android.com/reference/java/util/Arrays#spliterator(double[],%20int,%20int)`.

The returned spliterator always reports the characteristics
`SIZED` and `SUBSIZED`. The caller may provide additional
characteristics for the spliterator to report. (For example, if it is
known the array will not be further modified, specify `IMMUTABLE`;
if the array data is considered to have an encounter order, specify
`ORDERED`). The method `https://developer.android.com/reference/java/util/Arrays#spliterator(long[],%20int,%20int)` can
often be used instead, which returns a spliterator that reports
`SIZED`, `SUBSIZED`, `IMMUTABLE`, and `ORDERED`.

<br />

| Parameters ||
|---|---|
| `array` | `double`: The array, assumed to be unmodified during use <br /> |
| `fromIndex` | `int`: The least index (inclusive) to cover <br /> |
| `toIndex` | `int`: One past the greatest index to cover <br /> |
| `additionalCharacteristics` | `int`: Additional spliterator characteristics of this spliterator's source or elements beyond `SIZED` and `SUBSIZED` which are always reported <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfDouble` | A spliterator for an array <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException` | if `fromIndex` is negative, `toIndex` is less than `fromIndex`, or `toIndex` is greater than the array size |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given array is `null` |

**See also:**

- `https://developer.android.com/reference/java/util/Arrays#spliterator(double[],%20int,%20int)`

### spliterator

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfInt spliterator (PrimitiveIterator.OfInt iterator, 
                long size, 
                int characteristics)
```

Creates a `Spliterator.OfInt` using a given
`IntStream.IntIterator` as the source of elements, and with a given
initially reported size.

The spliterator is not
*[late-binding](https://developer.android.com/reference/java/util/Spliterator#binding)* , inherits
the *fail-fast* properties of the iterator, and implements
`trySplit` to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator.
The behaviour of splitting and traversal is undefined if the iterator is
operated on after the spliterator is returned, or the initially reported
size is not equal to the actual number of elements in the source.

<br />

| Parameters ||
|---|---|
| `iterator` | `PrimitiveIterator.OfInt`: The iterator for the source <br /> |
| `size` | `long`: The number of elements in the source, to be reported as initial `estimateSize`. <br /> |
| `characteristics` | `int`: Characteristics of this spliterator's source or elements. The characteristics `SIZED` and `SUBSIZED` are additionally reported unless `CONCURRENT` is supplied. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfInt` | A spliterator from an iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given iterator is `null` |

### spliteratorUnknownSize

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfInt spliteratorUnknownSize (PrimitiveIterator.OfInt iterator, 
                int characteristics)
```

Creates a `Spliterator.OfInt` using a given
`IntStream.IntIterator` as the source of elements, with no initial
size estimate.

The spliterator is not
*[late-binding](https://developer.android.com/reference/java/util/Spliterator#binding)* , inherits
the *fail-fast* properties of the iterator, and implements
`trySplit` to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator.
The behaviour of splitting and traversal is undefined if the iterator is
operated on after the spliterator is returned.

<br />

| Parameters ||
|---|---|
| `iterator` | `PrimitiveIterator.OfInt`: The iterator for the source <br /> |
| `characteristics` | `int`: Characteristics of this spliterator's source or elements (`SIZED` and `SUBSIZED`, if supplied, are ignored and are not reported.) <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfInt` | A spliterator from an iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given iterator is `null` |

### spliteratorUnknownSize

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator<T> spliteratorUnknownSize (Iterator<? extends T> iterator, 
                int characteristics)
```

Creates a `Spliterator` using a given `Iterator`
as the source of elements, with no initial size estimate.

The spliterator is not
*[late-binding](https://developer.android.com/reference/java/util/Spliterator#binding)* , inherits
the *fail-fast* properties of the iterator, and implements
`trySplit` to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator.
The behaviour of splitting and traversal is undefined if the iterator is
operated on after the spliterator is returned.

<br />

| Parameters ||
|---|---|
| `iterator` | `Iterator`: The iterator for the source <br /> |
| `characteristics` | `int`: Characteristics of this spliterator's source or elements (`SIZED` and `SUBSIZED`, if supplied, are ignored and are not reported.) <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator<T>` | A spliterator from an iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given iterator is `null` |

### spliteratorUnknownSize

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfDouble spliteratorUnknownSize (PrimitiveIterator.OfDouble iterator, 
                int characteristics)
```

Creates a `Spliterator.OfDouble` using a given
`DoubleStream.DoubleIterator` as the source of elements, with no
initial size estimate.

The spliterator is not
*[late-binding](https://developer.android.com/reference/java/util/Spliterator#binding)* , inherits
the *fail-fast* properties of the iterator, and implements
`trySplit` to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator.
The behaviour of splitting and traversal is undefined if the iterator is
operated on after the spliterator is returned.

<br />

| Parameters ||
|---|---|
| `iterator` | `PrimitiveIterator.OfDouble`: The iterator for the source <br /> |
| `characteristics` | `int`: Characteristics of this spliterator's source or elements (`SIZED` and `SUBSIZED`, if supplied, are ignored and are not reported.) <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfDouble` | A spliterator from an iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given iterator is `null` |

### spliteratorUnknownSize

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Spliterator.OfLong spliteratorUnknownSize (PrimitiveIterator.OfLong iterator, 
                int characteristics)
```

Creates a `Spliterator.OfLong` using a given
`LongStream.LongIterator` as the source of elements, with no
initial size estimate.

The spliterator is not
*[late-binding](https://developer.android.com/reference/java/util/Spliterator#binding)* , inherits
the *fail-fast* properties of the iterator, and implements
`trySplit` to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator.
The behaviour of splitting and traversal is undefined if the iterator is
operated on after the spliterator is returned.

<br />

| Parameters ||
|---|---|
| `iterator` | `PrimitiveIterator.OfLong`: The iterator for the source <br /> |
| `characteristics` | `int`: Characteristics of this spliterator's source or elements (`SIZED` and `SUBSIZED`, if supplied, are ignored and are not reported.) <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Spliterator.OfLong` | A spliterator from an iterator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the given iterator is `null` |