Package org.apache.commons.io.function

# Interface IOIterable<T>

Type Parameters:
  `T` - the type of elements returned by the iterable.

All Known Implementing Classes:
  `ReversedLinesFileReader`

public interface IOIterable<T>
Like `Iterable` but throws `IOException`.

Since:
  2.19.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `forEach(IOConsumer<? super T> action)`
  Like `Iterable.iterator()`.
  `IOIterator<T>`
  `iterator()`
  Like `Iterable.iterator()`.
  `default IOSpliterator<T>`
  `spliterator()`
  Like `Iterable.spliterator()`.
  `Iterable<T>`
  `unwrap()`
  Unwraps this instance and returns the underlying `Iterable`.

- ## Method Details

  - ### forEach

    default void forEach(IOConsumer<? super T> action) throws IOException
    Like `Iterable.iterator()`.
    Parameters:
      `action` - The action to be performed for each element.
    Throws:
      `NullPointerException` - if the specified action is null.
      `IOException` - thrown by the given action.
    See Also:
      - `Iterable.iterator()`

  - ### iterator

    IOIterator<T> iterator()
    Like `Iterable.iterator()`.
    Returns:
      See `delegate`.
    See Also:
      - `Iterable.iterator()`

  - ### spliterator

    default IOSpliterator<T> spliterator()
    Like `Iterable.spliterator()`.
    Returns:
      See `delegate`.
    See Also:
      - `Iterable.spliterator()`

  - ### unwrap

    Iterable<T> unwrap()
    Unwraps this instance and returns the underlying `Iterable`.

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

    Returns:
      the underlying Iterable.