Package soot.util

Class SharedCloseable<T extends Closeable>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    AutoCloseable

    public final class SharedCloseable<T extends Closeable>
    extends Object
    implements AutoCloseable
    Reference counting wrapper for a Closeable that closes the resource when the reference count reaches 0. Extends AutoCloseable so that each region using the resource can simply be wrapped in a try-with-resources block.
    Author:
    Timothy Hoffman
    See Also:
    AutoCloseable
    • Constructor Detail

      • SharedCloseable

        public SharedCloseable​(T resource)