public final class AutoClosableUtils
extends java.lang.Object
AutoCloseable
.Modifier and Type | Method and Description |
---|---|
static void |
closeAndReThrowIoException(java.lang.AutoCloseable closeable)
Call
AutoCloseable.close() and re-throw any exceptions as a IOException . |
static void |
closeAndReThrowUnchecked(java.lang.AutoCloseable closeable)
Call
AutoCloseable.close() and re-throw any exceptions as an unchecked exception. |
public static void closeAndReThrowUnchecked(java.lang.AutoCloseable closeable)
AutoCloseable.close()
and re-throw any exceptions as an unchecked exception.closeable
- The object to close.public static void closeAndReThrowIoException(java.lang.AutoCloseable closeable) throws java.io.IOException
AutoCloseable.close()
and re-throw any exceptions as a IOException
.closeable
- The object to close.java.io.IOException
- if an exception occurs during AutoCloseable.close()
.