Convert a Closeable to a Runnable by converting checked IOException to UncheckedIOException
(Closeable c)
| 78 | * to UncheckedIOException |
| 79 | */ |
| 80 | private static Runnable asUncheckedRunnable(Closeable c) { |
| 81 | return () -> { |
| 82 | try { |
| 83 | c.close(); |
| 84 | } catch (IOException e) { |
| 85 | throw new UncheckedIOException(e); |
| 86 | } |
| 87 | }; |
| 88 | } |
| 89 | |
| 90 | } |