public final class ProgressiveDownloader extends java.lang.Object implements Downloader
| Constructor and Description |
|---|
ProgressiveDownloader(android.net.Uri uri,
java.lang.String customCacheKey,
DownloaderConstructorHelper constructorHelper) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Interrupts any current download operation and prevents future operations from running.
|
void |
download()
Downloads the media.
|
long |
getDownloadedBytes()
Returns the total number of downloaded bytes.
|
float |
getDownloadPercentage()
Returns the estimated download percentage, or
C.PERCENTAGE_UNSET if no estimate is
available. |
void |
remove()
Removes the media.
|
public ProgressiveDownloader(android.net.Uri uri,
java.lang.String customCacheKey,
DownloaderConstructorHelper constructorHelper)
uri - Uri of the data to be downloaded.customCacheKey - A custom key that uniquely identifies the original stream. Used for cache
indexing. May be null.constructorHelper - A DownloaderConstructorHelper instance.public void download()
throws java.lang.InterruptedException,
java.io.IOException
Downloaderdownload in interface Downloaderjava.lang.InterruptedException - If the thread has been interrupted.DownloadException - Thrown if the media cannot be downloaded.java.io.IOException - Thrown when there is an io error while downloading.public void cancel()
Downloadercancel in interface Downloaderpublic long getDownloadedBytes()
DownloadergetDownloadedBytes in interface Downloaderpublic float getDownloadPercentage()
DownloaderC.PERCENTAGE_UNSET if no estimate is
available.getDownloadPercentage in interface Downloaderpublic void remove()
Downloaderremove in interface Downloader