Interface IOBiConsumer<T,​U>

  • Type Parameters:
    T - the type of the first argument to the operation
    U - the type of the second argument to the operation
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface IOBiConsumer<T,​U>
    Represents an operation that accepts two input arguments and returns no result. This is the two-arity specialization of Consumer. Unlike most other functional interfaces, BiConsumer is expected to operate via side-effects.

    This interface is similar to BiConsumer except that it is allowed to throw an IOException.

    Author:
    Magno N A Cruz
    See Also:
    IOConsumer
    • Method Detail

      • accept

        void accept​(T t,
                    U u)
             throws java.io.IOException

        This method is the same as BiConsumer.accept(Object, Object), but with a support for IOException.

        Parameters:
        t - The first input.
        u - The second input.
        Throws:
        java.io.IOException - if there is an I/O error performing the operation.
      • andThen

        default IOBiConsumer<T,​U> andThen​(@Nonnull
                                                IOBiConsumer<? super T,​? super U> after)
                                         throws java.io.IOException

        This method is the same as BiConsumer.andThen(BiConsumer), but with a support for IOException.

        Parameters:
        after - The operation to be performed after this operation.
        Returns:
        A composed IOBiConsumer that performs this operation followed by the after operation in sequence.
        Throws:
        java.io.IOException - if there is an I/O error performing the operation.