public interface

CacheDataSource.EventListener

 androidx.media3.datasource.cache.CacheDataSource.EventListener

Overview

Listener of CacheDataSource events.

Summary

Methods
public voidonCachedBytesRead(long cacheSizeBytes, long cachedBytesRead)

Called when bytes have been read from the cache.

public voidonCacheIgnored(int reason)

Called when the current request ignores cache.

Methods

public void onCachedBytesRead(long cacheSizeBytes, long cachedBytesRead)

Called when bytes have been read from the cache.

Parameters:

cacheSizeBytes: Current cache size in bytes.
cachedBytesRead: Total bytes read from the cache since this method was last called.

public void onCacheIgnored(int reason)

Called when the current request ignores cache.

Parameters:

reason: Reason cache is bypassed.