Hugh Edwards
02/22/2023, 1:18 AM<http://dispatchers.IO|dispatchers.IO>
In here I start an HttpUrlConnection & call openConnection() on it
I await this connection in a coroutine under dispatchers.default
where i then do
val inputStream = connectionJob.await()
processZipFile(inputStream.inputStream)
inputStream.disconnect()
and in processZipFile i create a zip entry stream from the IS, iterate through each entry, creating a buffered output stream per file (4096 buffer size to read) before closing it all
Is this doing the download on the wrong dispatcher due to the await placement?
Also is this keeping the connection open while unzipping as opposed to getting the whole thing in memory before processing it?
Looking for any suggestions and improvements, thanksHugh Edwards
02/22/2023, 1:41 AM