public static Spliterator.OfInt spliterator(int[] array, int fromIndex, int toIndex,
                                                int additionalCharacteristics) {
        checkFromToBounds(Objects.requireNonNull(array).length, fromIndex, toIndex);
        return new IntArraySpliterator(array, fromIndex, toIndex, additionalCharacteristics);
    }
public static Spliterator . OfInt spliterator ( int [ ] array , int fromIndex , int toIndex , int additionalCharacteristics ) { checkFromToBounds ( Objects . requireNonNull ( array ) . length , fromIndex , toIndex ) ; return new IntArraySpliterator ( array , fromIndex , toIndex , additionalCharacteristics ) ; }
Creates a {@code Spliterator.OfInt} covering a range of elements of a
given array, using a customized set of spliterator characteristics.

<p>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
{@link Arrays#spliterator(int[], int, int)}.

<p>The returned spliterator always reports the characteristics
{@code SIZED} and {@code SUBSIZED}.  The caller may provide additional
characteristics for the spliterator to report; it is common to
additionally specify {@code IMMUTABLE} and {@code ORDERED}.

@param array The array, assumed to be unmodified during use
@param fromIndex The least index (inclusive) to cover
@param toIndex One past the greatest index to cover
@param additionalCharacteristics Additional spliterator characteristics
of this spliterator's source or elements beyond {@code SIZED} and
{@code SUBSIZED} which are are always reported
@return A spliterator for an array
@throws NullPointerException if the given array is {@code null}
@throws ArrayIndexOutOfBoundsException if {@code fromIndex} is negative,
{@code toIndex} is less than {@code fromIndex}, or
{@code toIndex} is greater than the array size
@see Arrays#spliterator(int[], int, int)