Kong/unirest-java

Unirest reads entire stream to memory even if requested to get InputStream

amirlanesman opened this issue · 3 comments

Even when requested to return response as an InputStream (.asBinary()) the entire response is read to memory, this makes it impossible to get responses that don't fit into memory.

Is the above commit fixed this issue?

So while I think the above commit will fix this issue (from looking at the code) the pull request to merge it with the main project is still pending. It seems like active development has stopped and it is no longer really actively maintained. I guess you could pull this code and do a build from it but by adding the Maven dependency (I tried for 1.4.9) it still buffers the whole stream

Link to pull request: #136

ryber commented

Hello, this should be resolved or addressed in Unirest 2. Please see the upgrade guide for important changes.