Hi <@U0B0WETDM> , I need your help about an `OutOf...
# kotlin-fuel
p
Hi @kittinunf , I need your help about an
OutOfMemoryError: Java heap space
I’m facing. I’m trying to download a file and write its content in a file like that:
Copy code
val result = location.httpGet().response()
destination.writeBytes(result.third.get())
Is there some built-in helper in order to help avoiding memory issues? thx in advance 🙏
At the end this section samples https://github.com/kittinunf/fuel/blob/master/fuel/README.md#download-response-to-output-file-or-outputstream and end up with this code:
Copy code
val response = location.httpDownload()
            .fileDestination { _, _ -> destination }
            .response()
check(response.second.statusCode == 200) { "Invalid download: $response" }
k
Does it work?
p
like a charm 👍 as long as I’m not requesting the response.data explicitly, it’s working fine
k
kk, are you downloading movie or something? lol
p
Sadly nothing as fun as movies 😆