public static interface FileDownloadHelper.ConnectionCountAdapter
| Modifier and Type | Method and Description |
|---|---|
int |
determineConnectionCount(int downloadId,
String url,
String path,
long totalLength)
Before invoke this method to determine how many connection will be used to downloading
this task,
there are several conditions must be confirmed:
|
int determineConnectionCount(int downloadId,
String url,
String path,
long totalLength)
1. the connection is support multiple connection(SUPPORT"Partial Content(206)" AND NOT
Chunked)
2. the current FileDownloadOutputStream support seek(The default
one(FileDownloadRandomAccessFile is support)
3. this is a new task NOT resume from breakpoint( If the task resume from breakpoint
the connection count would be using
the one you determined when the task
first created ).
downloadId - the download id.url - the task url.path - the task path.totalLength - the total length of the file.