How to use stream in retrofit 2 when downloading large amounts of data?

Good day!
I need to receive large files from the server as a string base64 encoded, wrapped in the soap response from the server(Yes, a strange method)
I tried to use @Streaming for retrofit 2 based on instructions from this site

On the test file, the direct link from Google drive, manual is working fine and is downloaded 400 MB file using ((Response)response).body().byteStream(), but when you try to crank out the same c "my" server, retrofit somehow deflates the entire file(all xml (soap)), but does not control byteStream, causing crashes from lack of memory.
Please tell me what can be the reason of such behavior.
P. S. feel free to request additional information, all provided, just now I do not know that you may need, and the whole point of the code shown in the instructions at the link provided above.
June 3rd 19 at 19:00
0 answer

Find more questions by tags Android