Package 

Class DiskCacheManager


  • 
    public final class DiskCacheManager
    
                        

    Disk-based cache for rendered PDF tile bitmaps. Caches tiles to the app's cache directory for fast reopening of PDFs. Uses WebP format for 30-50% smaller file sizes.

    • Constructor Detail

      • DiskCacheManager

        DiskCacheManager(Context context)
    • Method Detail

      • getCacheKey

         final String getCacheKey(String documentHash, Integer page, RectF bounds, Float zoom)

        Generate a unique cache key for a tile.

        Parameters:
        documentHash - Unique identifier for the document (e.g.
        page - Page index
        bounds - Tile bounds (relative coordinates)
        zoom - Zoom level
      • saveTileAsync

         final Unit saveTileAsync(String cacheKey, Bitmap bitmap)

        Save a tile asynchronously to avoid blocking render thread. Creates a copy of the bitmap since original may be recycled.

      • shutdown

         final Unit shutdown()

        Shutdown the executor when no longer needed.