Class IOStreams


  • final class IOStreams
    extends java.lang.Object
    Keep this code package-private for now.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static java.lang.Object NONE  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private IOStreams()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static <T> void forAll​(java.util.stream.Stream<T> stream, IOConsumer<T> action)  
      (package private) static <T> void forAll​(java.util.stream.Stream<T> stream, IOConsumer<T> action, java.util.function.BiFunction<java.lang.Integer,​java.io.IOException,​java.io.IOException> exSupplier)  
      (package private) static <T> void forEach​(java.util.stream.Stream<T> stream, IOConsumer<T> action)  
      (package private) static <T> java.util.stream.Stream<T> of​(java.lang.Iterable<T> values)
      Null-safe version of StreamSupport.stream(java.util.Spliterator, boolean).
      (package private) static <T> java.util.stream.Stream<T> of​(java.util.stream.Stream<T> stream)  
      (package private) static <T> java.util.stream.Stream<T> of​(T... values)
      Null-safe version of Stream.of(Object[]).
      (package private) static <T> IOConsumer<T> toIOConsumer​(IOConsumer<T> action)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NONE

        static final java.lang.Object NONE
    • Constructor Detail

      • IOStreams

        private IOStreams()
    • Method Detail

      • forAll

        static <T> void forAll​(java.util.stream.Stream<T> stream,
                               IOConsumer<T> action,
                               java.util.function.BiFunction<java.lang.Integer,​java.io.IOException,​java.io.IOException> exSupplier)
                        throws IOExceptionList
        Throws:
        IOExceptionList
      • forEach

        static <T> void forEach​(java.util.stream.Stream<T> stream,
                                IOConsumer<T> action)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • of

        static <T> java.util.stream.Stream<T> of​(java.lang.Iterable<T> values)
        Null-safe version of StreamSupport.stream(java.util.Spliterator, boolean). Copied from Apache Commons Lang.
        Type Parameters:
        T - the type of stream elements.
        Parameters:
        values - the elements of the new stream, may be null.
        Returns:
        the new stream on values or Stream.empty().
      • of

        static <T> java.util.stream.Stream<T> of​(java.util.stream.Stream<T> stream)
      • of

        @SafeVarargs
        static <T> java.util.stream.Stream<T> of​(T... values)
        Null-safe version of Stream.of(Object[]). Copied from Apache Commons Lang.
        Type Parameters:
        T - the type of stream elements.
        Parameters:
        values - the elements of the new stream, may be null.
        Returns:
        the new stream on values or Stream.empty().