Class StaticCache.LockSafeOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable
    Enclosing class:
    StaticCache

    static class StaticCache.LockSafeOutputStream
    extends FilterOutputStream
    A lock-safe output stream that releases the associated write lock when the stream is closed.

    NOTE! It is important that we keep a strong reference to the 'key' in this class until the stream is closed, since otherwise the locked entry may be reclaimed by the garbage collector.