@Deprecated public final class CacheWriter extends ObjectDeprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Caching related utility methods.
Nested Class Summary
Nested Classes Modifier and Type Class Description
CacheWriter.ProgressListenerDeprecated.Receives progress updates during cache operations.
Fields Modifier and Type Field Description
DEFAULT_BUFFER_SIZE_BYTESDeprecated.Default buffer size to be used while caching.
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description
cache()Deprecated.Caches the requested data, skipping any that's already cached.
cancel()Deprecated.Cancels this writer's caching operation.
public static final int DEFAULT_BUFFER_SIZE_BYTESDeprecated.Default buffer size to be used while caching.
- See Also:
- Constant Field Values
public CacheWriter(CacheDataSource dataSource, DataSpec dataSpec, @Nullable byte temporaryBuffer, @Nullable CacheWriter.ProgressListener progressListener)Deprecated.
CacheDataSourcethat writes to the target cache.
dataSpec- Defines the data to be written.
temporaryBuffer- A temporary buffer to be used during caching, or
nullif the writer should instantiate its own internal temporary buffer.
progressListener- An optional progress listener.
public void cancel()Deprecated.
@WorkerThread public void cache() throws IOExceptionDeprecated.Caches the requested data, skipping any that's already cached.
CacheDataSourceused by the writer has a
PriorityTaskManager, then it's the responsibility of the caller to call
PriorityTaskManager.add(int)to register with the manager before calling this method, and to call
PriorityTaskManager.remove(int)afterwards to unregister.
PriorityTaskManager.PriorityTooLowExceptionwill be thrown if the priority required by the
CacheDataSourceis not high enough for progress to be made.
This method may be slow and shouldn't normally be called on the main thread.