Class CacheWriter


  • @Deprecated
    public final class CacheWriter
    extends Object
    Deprecated.
    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.
    • Field Detail

      • DEFAULT_BUFFER_SIZE_BYTES

        public static final int DEFAULT_BUFFER_SIZE_BYTES
        Deprecated.
        Default buffer size to be used while caching.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CacheWriter

        public CacheWriter​(CacheDataSource dataSource,
                           DataSpec dataSpec,
                           @Nullable
                           byte[] temporaryBuffer,
                           @Nullable
                           CacheWriter.ProgressListener progressListener)
        Deprecated.
        Parameters:
        dataSource - A CacheDataSource that writes to the target cache.
        dataSpec - Defines the data to be written.
        temporaryBuffer - A temporary buffer to be used during caching, or null if the writer should instantiate its own internal temporary buffer.
        progressListener - An optional progress listener.
    • Method Detail

      • cancel

        public void cancel()
        Deprecated.
        Cancels this writer's caching operation. cache checks for cancelation frequently during execution, and throws an InterruptedIOException if it sees that the caching operation has been canceled.