Interface IOIntConsumer

  • 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 IOIntConsumer
    Represents an operation that accepts a single int-valued argument and returns no result. This is the primitive type specialization of Consumer for int. Unlike most other functional interfaces, IntConsumer is expected to operate via side-effects.

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

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

      • accept

        void accept​(int value)
             throws java.io.IOException

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

        Parameters:
        value - The input argument.
        Throws:
        java.io.IOException - if there is an I/O error performing the operation.
      • andThen

        default IOIntConsumer andThen​(@Nonnull
                                      IOIntConsumer after)
                               throws java.io.IOException

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

        Parameters:
        after - The operation to perform after this operation.
        Returns:
        A composed IntConsumer 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.