Interface IOBaseStream<T,​S extends IOBaseStream<T,​S,​B>,​B extends java.util.stream.BaseStream<T,​B>>

  • Type Parameters:
    T - the type of the stream elements.
    S - the type of the IO stream extending IOBaseStream.
    B - the type of the stream extending BaseStream.
    All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Subinterfaces:
    IOStream<T>

    public interface IOBaseStream<T,​S extends IOBaseStream<T,​S,​B>,​B extends java.util.stream.BaseStream<T,​B>>
    extends java.io.Closeable
    Like BaseStream but throws IOException.
    Since:
    2.12.0
    • Method Detail

      • asBaseStream

        default java.util.stream.BaseStream<T,​B> asBaseStream()
        Creates a BaseStream for this instance that throws UncheckedIOException instead of IOException.
        Returns:
        an UncheckedIOException BaseStream.
      • close

        default void close()
        Like BaseStream.close().
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        See Also:
        BaseStream.close()
      • isParallel

        default boolean isParallel()
        Like BaseStream.isParallel().
        Returns:
        See delegate.
        See Also:
        BaseStream.isParallel()
      • iterator

        default IOIterator<T> iterator()
        Like BaseStream.iterator().
        Returns:
        See delegate.
        See Also:
        BaseStream.iterator()
      • onClose

        default S onClose​(IORunnable closeHandler)
                   throws java.io.IOException
        Like BaseStream.onClose(Runnable).
        Parameters:
        closeHandler - See delegate.
        Returns:
        See delegate.
        Throws:
        java.io.IOException - if an I/O error occurs.
        See Also:
        BaseStream.onClose(Runnable)
      • parallel

        default S parallel()
        Like BaseStream.parallel().
        Returns:
        See delegate.
        See Also:
        BaseStream.parallel()
      • sequential

        default S sequential()
        Like BaseStream.sequential().
        Returns:
        See delegate.
        See Also:
        BaseStream.sequential()
      • spliterator

        default IOSpliterator<T> spliterator()
        Like BaseStream.spliterator().
        Returns:
        See delegate.
        See Also:
        BaseStream.spliterator()
      • unordered

        default S unordered()
        Like BaseStream.unordered().
        Returns:
        See delegate.
        See Also:
        BaseStream.unordered()
      • unwrap

        B unwrap()
        Unwraps this instance and returns the underlying Stream.

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

        Returns:
        the underlying stream.
      • wrap

        S wrap​(B delegate)
        Wraps a Stream.
        Parameters:
        delegate - The delegate.
        Returns:
        An IO stream.