ResumableModelDownloader

class ResumableModelDownloader(bearerToken: String? = null, bufferSize: Int = 64 * 1024, connectTimeoutMs: Int, readTimeoutMs: Int, nanoTime: () -> Long = System::nanoTime)

Constructors

Link copied to clipboard
constructor(bearerToken: String? = null, bufferSize: Int = 64 * 1024, connectTimeoutMs: Int, readTimeoutMs: Int, nanoTime: () -> Long = System::nanoTime)

Functions

Link copied to clipboard
fun download(url: String, target: File): Flow<DownloadProgress>

Downloads url into target, resuming from <target>.tmp if a partial exists, emitting a DownloadProgress per buffer. On success the .tmp is renamed to target; on cancellation the .tmp is left in place for the next resume.