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