public interface CloseableIterator<T>
extends java.util.Iterator<T>, java.io.Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Should be implemented to close/release any underlying resources.
|
default java.util.stream.Stream<T> |
stream()
Returns a Stream that will consume from the underlying iterator.
|
default java.util.List<T> |
toList()
Consumes the contents of the iterator and returns it as a List.
|
void close()
close in interface java.lang.AutoCloseableclose in interface java.io.Closeabledefault java.util.List<T> toList()
default java.util.stream.Stream<T> stream()