Skip to content

Instantly share code, notes, and snippets.

@lordcodes
Created February 25, 2020 20:17
Show Gist options
  • Save lordcodes/75b3216656553636912120e1580c0c62 to your computer and use it in GitHub Desktop.
Save lordcodes/75b3216656553636912120e1580c0c62 to your computer and use it in GitHub Desktop.
Code for the article: "Uploading a file with progress in Kotlin"
class CountingRequestBody(
private val requestBody: RequestBody,
private val onProgressUpdate: CountingRequestListener
) : RequestBody() {
override fun contentType() = requestBody.contentType()
@Throws(IOException::class)
override fun contentLength() = requestBody.contentLength()
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment