2

I have developed an android application which will consume a large data in a zipped format. i used to unzip it and when i parse the unzipped file it shows outofmemory error since the Heap size increased to 125MB. I am using apache commons.io to fetch byte[] b and i am giving String s =new String(b);I tried Stringbuilder but i cant get that logic in place. Is there any other way to safely convert byte[] to String in android?

Anand Asir
  • 309
  • 3
  • 13

1 Answers1

6

There isn't a way to convert that much data at once (125MB) to a string. You're better off doing this in incremental steps in more mangeable chunks.

hwrdprkns
  • 7,525
  • 12
  • 48
  • 69