Progress

data class Progress(val bytesRead: Long, val contentLength: Long?) : DownloadResult

Emitted repeatedly as bytes are streamed from the server.

contentLength may be null if the server/proxy did not report Content-Length (e.g. chunked transfer encoding, OkHttp's transparent gzip re-encoding). Consumers should fall back to an indeterminate progress UI when null.

Constructors

Link copied to clipboard
constructor(bytesRead: Long, contentLength: Long?)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Convenience property: the percentage of the download complete (0–100), or null if contentLength is unknown or zero.