org.apache.commons.io.function

## Class IOIteratorAdapter<E>

- java.lang.Object
- - org.apache.commons.io.function.IOIteratorAdapter<E>

- Type Parameters:
    `E` - the type of the stream elements.
  All Implemented Interfaces:
    IOIterator<E>

      final class IOIteratorAdapter<E>
      extends Object
      implements IOIterator<E>

  Adapts an `Iterator` as an `IOIterator`.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) static <E> IOIteratorAdapter<E>` | `adapt(Iterator<E> delegate)` Adapts the given Iterator as an IOIterator.
    `boolean` | `hasNext()` Like `Iterator.hasNext()`.
    `E` | `next()` Like `Iterator.next()`.
    `Iterator<E>` | `unwrap()` Unwraps this instance and returns the underlying `Iterator`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.commons.io.function.IOIterator

      `adapt, asIterator, forEachRemaining, remove`

- - ### Method Detail

    - #### adapt

          static <E> IOIteratorAdapter<E> adapt(Iterator<E> delegate)

      Description copied from interface: `IOIterator`
      Adapts the given Iterator as an IOIterator.
      Specified by:
        `adapt` in interface `IOIterator<E>`
      Type Parameters:
        `E` - the type of the stream elements.
      Parameters:
        `delegate` - The iterator to adapt
      Returns:
        A new IOIterator

    - #### hasNext

          public boolean hasNext()
                          throws IOException

      Description copied from interface: `IOIterator`
      Like `Iterator.hasNext()`.
      Specified by:
        `hasNext` in interface `IOIterator<E>`
      Returns:
        See delegate.
      Throws:
        `IOException` - if an I/O error occurs.

    - #### next

          public E next()
                 throws IOException

      Description copied from interface: `IOIterator`
      Like `Iterator.next()`.
      Specified by:
        `next` in interface `IOIterator<E>`
      Returns:
        See delegate.
      Throws:
        `IOException` - if an I/O error occurs.

    - #### unwrap

          public Iterator<E> unwrap()

      Description copied from interface: `IOIterator`
      Unwraps this instance and returns the underlying `Iterator`.

      Implementations may not have anything to unwrap and that behavior is undefined for now.

      Specified by:
        `unwrap` in interface `IOIterator<E>`
      Returns:
        the underlying Iterator.