Class IoTools.Unchecked<C extends AutoCloseable>

  • Type Parameters:
    C - The type of the closeable of which to wrap any exception from AutoCloseable.close().
    All Implemented Interfaces:
    AutoCloseable
    Enclosing class:
    IoTools

    public static class IoTools.Unchecked<C extends AutoCloseable>
    extends Object
    This class wraps an AutoCloseable and wraps the exception from closing in a RuntimeException if necessary.
    • Constructor Detail

      • Unchecked

        protected Unchecked​(C wrapped)
        Creates a new closeable wrapping the designated AutoCloseable wrapping any exception from AutoCloseable.close().
        Parameters:
        wrapped - The wrapped AutoCloseable.
    • Method Detail

      • close

        public void close()
        Closes the wrapped AutoCloseable and wraps any Exception.