Class AutoClosableUtils
- java.lang.Object
-
- io.servicetalk.concurrent.internal.AutoClosableUtils
-
public final class AutoClosableUtils extends java.lang.Object
Utilities forAutoCloseable
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeAndReThrowIoException(java.lang.AutoCloseable closeable)
CallAutoCloseable.close()
and re-throw any exceptions as aIOException
.static void
closeAndReThrowUnchecked(java.lang.AutoCloseable closeable)
CallAutoCloseable.close()
and re-throw any exceptions as an unchecked exception.
-
-
-
Method Detail
-
closeAndReThrowUnchecked
public static void closeAndReThrowUnchecked(java.lang.AutoCloseable closeable)
CallAutoCloseable.close()
and re-throw any exceptions as an unchecked exception.- Parameters:
closeable
- The object to close.
-
closeAndReThrowIoException
public static void closeAndReThrowIoException(java.lang.AutoCloseable closeable) throws java.io.IOException
CallAutoCloseable.close()
and re-throw any exceptions as aIOException
.- Parameters:
closeable
- The object to close.- Throws:
java.io.IOException
- if an exception occurs duringAutoCloseable.close()
.
-
-