/* ------------------------------------------------------------ */
    protected void invalidate() {
      ByteBuffer indirect = _indirectBuffer.get();
      if (indirect != null && _indirectBuffer.compareAndSet(indirect, null))
        _cachedSize.addAndGet(-BufferUtil.length(indirect));

      ByteBuffer direct = _directBuffer.get();
      if (direct != null
          && !BufferUtil.isMappedBuffer(direct)
          && _directBuffer.compareAndSet(direct, null))
        _cachedSize.addAndGet(-BufferUtil.length(direct));

      _cachedFiles.decrementAndGet();
      _resource.close();
    }
示例#2
0
 /**
  * Release any temporary resources held by the resource.
  *
  * @deprecated use {@link #close()}
  */
 public final void release() {
   close();
 }
示例#3
0
 /* ------------------------------------------------------------ */
 @Override
 protected void finalize() {
   close();
 }