@FunctionalInterface
public interface IntIterable
extends java.lang.Iterable<java.lang.Integer>
| Modifier and Type | Method and Description |
|---|---|
default java.io.InputStream |
asInputStream() |
default void |
forEach(java.util.function.Consumer<? super java.lang.Integer> consumer)
Performs the given action for each
int in this iterable. |
default void |
forEachInt(java.util.function.IntConsumer consumer)
Performs the given action for each
int in this iterable. |
static IntIterable |
from(java.lang.Integer... integers) |
static IntIterable |
from(java.lang.Iterable<java.lang.Integer> iterable) |
IntIterator |
iterator() |
static IntIterable |
of(int... integers) |
static IntIterable |
once(IntIterator iterator) |
static IntIterable |
once(java.util.PrimitiveIterator.OfInt iterator) |
static IntIterable |
read(java.io.InputStream inputStream)
Create an
IntSequence from an InputStream which iterates over the bytes provided in the
input stream as ints. |
static IntIterable read(java.io.InputStream inputStream)
IntSequence from an InputStream which iterates over the bytes provided in the
input stream as ints. The InputStream must support InputStream.reset() or the IntSequence
will only be available to iterate over once. The InputStream will be reset in between iterations,
if possible. If an IOException occurs during iteration, an IterationException will be thrown.
The InputStream will not be closed by the IntSequence when iteration finishes, it must be closed
externally when iteration is finished.IntIterator iterator()
iterator in interface java.lang.Iterable<java.lang.Integer>default void forEach(java.util.function.Consumer<? super java.lang.Integer> consumer)
int in this iterable.forEach in interface java.lang.Iterable<java.lang.Integer>default void forEachInt(java.util.function.IntConsumer consumer)
int in this iterable.static IntIterable of(int... integers)
static IntIterable from(java.lang.Integer... integers)
static IntIterable from(java.lang.Iterable<java.lang.Integer> iterable)
static IntIterable once(IntIterator iterator)
static IntIterable once(java.util.PrimitiveIterator.OfInt iterator)
default java.io.InputStream asInputStream()
IntIterable as an InputStream. Mark and reset is supported, by re-traversing
the iterator to the mark position. Ints outside of the allowed range 0 to 255 will result in
an IOException being thrown during traversal.