E
- the type of the stream elements.final class IOIteratorAdapter<E> extends java.lang.Object implements IOIterator<E>
Iterator
as an IOIterator
.Constructor and Description |
---|
IOIteratorAdapter(java.util.Iterator<E> delegate) |
Modifier and Type | Method and Description |
---|---|
(package private) static <E> IOIteratorAdapter<E> |
adapt(java.util.Iterator<E> delegate)
Adapts the given Iterator as an IOIterator.
|
boolean |
hasNext()
Like
Iterator.hasNext() . |
E |
next()
Like
Iterator.next() . |
java.util.Iterator<E> |
unwrap()
Unwraps this instance and returns the underlying
Iterator . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asIterator, forEachRemaining, remove
private final java.util.Iterator<E> delegate
IOIteratorAdapter(java.util.Iterator<E> delegate)
static <E> IOIteratorAdapter<E> adapt(java.util.Iterator<E> delegate)
IOIterator
adapt
in interface IOIterator<E>
E
- the type of the stream elements.delegate
- The iterator to adaptpublic boolean hasNext() throws java.io.IOException
IOIterator
Iterator.hasNext()
.hasNext
in interface IOIterator<E>
java.io.IOException
- if an I/O error occurs.public E next() throws java.io.IOException
IOIterator
Iterator.next()
.next
in interface IOIterator<E>
java.io.IOException
- if an I/O error occurs.public java.util.Iterator<E> unwrap()
IOIterator
Iterator
.
Implementations may not have anything to unwrap and that behavior is undefined for now.
unwrap
in interface IOIterator<E>