0

I try to store some video files on my phone.

When I get the file from the server, I call :

FileOutputStream fos = new FileOutputStream(file);
fos.write(response.body().bytes());
fos.close();

But my file is too big and I get this error message :

java.lang.OutOfMemoryError: Failed to allocate a 109117339 byte allocation with 8388608 free bytes and 19MB until OOM

What can I do to avoid this error and finally save my file ?

mctregouet
  • 23
  • 4

0 Answers0