Interface IOLongConsumer

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

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

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

      • accept

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

        This method is the same as LongConsumer.accept(long), 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 IOLongConsumer andThen​(@Nonnull
                                       IOLongConsumer after)
                                throws java.io.IOException

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

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