Skip to content

Commit

Permalink
Merge pull request #9664 from soerenreichardt/refactor-arrow-export-d…
Browse files Browse the repository at this point in the history
…rivers

Refactor arrow export drivers
  • Loading branch information
soerenreichardt authored Oct 10, 2024
2 parents 89e4a4b + 2c70135 commit 4c082c0
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Stream;

public final class ExceptionUtil {

Expand Down Expand Up @@ -95,6 +96,13 @@ public static <E extends Exception> void closeAll(
closeAll(handler, Arrays.asList(closeables));
}

public static <E extends Exception> void closeAll(
CheckedConsumer<Exception, E> handler,
Stream<AutoCloseable> closeables
) throws E {
closeAll(handler, closeables.iterator());
}

public static <E extends Exception> void closeAll(
CheckedConsumer<Exception, E> handler,
Iterable<? extends AutoCloseable> closeables
Expand Down

0 comments on commit 4c082c0

Please sign in to comment.