// 
// Decompiled by Procyon v0.6.0
// 

package it.unimi.dsi.fastutil.bytes;

import java.util.Comparator;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.Spliterator;

public interface ByteSpliterator extends Spliterator.OfPrimitive<Byte, ByteConsumer, ByteSpliterator>
{
    @Deprecated
    default boolean tryAdvance(final Consumer<? super Byte> action) {
        ByteConsumer byteConsumer;
        if (action instanceof ByteConsumer) {
            byteConsumer = (ByteConsumer)action;
        }
        else {
            Objects.requireNonNull(action);
            byteConsumer = action::accept;
        }
        return ((Spliterator.OfPrimitive<T, ByteConsumer, T_SPLITR>)this).tryAdvance(byteConsumer);
    }
    
    @Deprecated
    default void forEachRemaining(final Consumer<? super Byte> action) {
        ByteConsumer action2;
        if (action instanceof ByteConsumer) {
            action2 = (ByteConsumer)action;
        }
        else {
            Objects.requireNonNull(action);
            action2 = action::accept;
        }
        ((Spliterator.OfPrimitive<T, ByteConsumer, T_SPLITR>)this).forEachRemaining(action2);
    }
    
    default long skip(final long n) {
        if (n < 0L) {
            throw new IllegalArgumentException("Argument must be nonnegative: " + n);
        }
        long i = n;
        while (i-- != 0L && ((Spliterator.OfPrimitive<T, ByteConsumer, T_SPLITR>)this).tryAdvance(unused -> {})) {}
        return n - i - 1L;
    }
    
    ByteSpliterator trySplit();
    
    default ByteComparator getComparator() {
        throw new IllegalStateException();
    }
}
