ursus
12/12/2022, 7:00 PMinterface SpeedApi {
@Streaming
@GET
suspend fun download(@Url url: String): Response<ResponseBody>
}
val response = speedApi.download("...")
response.body.use {
it.byteStream().copyTo(...)
}
works, but the stream copying makes that blocking, and therefore not cancellable