public long getDiskUsedInBytes() { if (diskLruCache == null) { return -1; } else { return diskLruCache.size(); } }
public long getDiskUsedInBytes() { if (diskLruCache == null) { return -1; } else { return diskLruCache.size(); } }
/** * Returns the number of bytes currently being used to store the values in * the L2 disk cache. This may be greater than the max size if a background * deletion is pending. * * @return size */ public synchronized final long sizeDisk() { return mDiskCache == null ? 0 : mDiskCache.size(); }
final int DISK_CACHE_INDEX = 0; long currentMaxSize = cache.getMaxSize(); float percentageSize = Math.round((cache.size() * 100.0f) / currentMaxSize); if (percentageSize >= 90) // cache size reaches 90% cache.setMaxSize(currentMaxSize + (10 * 1024 * 1024)); // increase size to 10MB