Relative Content

Tag Archive for androidkotlinandroid-jetpack-composeretrofitretrofit2

Retrofit: Download a large text file using Retrofit with streaming support, and avoid loading the entire file into memory?

I’m trying to download a large text file using Retrofit, but I need to stream the file in chunks to avoid loading it entirely into memory. I’m working with large text files and want to ensure the file is streamed properly, but the entire response text is being loaded into memory.
I need to stream/load/read the data using responseBody.byteStream(). However, the data is still being loaded entirely into memory for text files, and the Content-Type: application/octet-stream is not bypassing this issue.