Thread
#kotlin-fuel
    p

    pgreze

    1 year ago
    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:
    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:
    val response = location.httpDownload()
                .fileDestination { _, _ -> destination }
                .response()
    check(response.second.statusCode == 200) { "Invalid download: $response" }
    kittinunf

    kittinunf

    1 year ago
    Does it work?
    p

    pgreze

    1 year ago
    like a charm 👍 as long as I’m not requesting the response.data explicitly, it’s working fine
    kittinunf

    kittinunf

    1 year ago
    kk, are you downloading movie or something? lol
    p

    pgreze

    1 year ago
    Sadly nothing as fun as movies 😆