I am storing byte array from JSONObject. this byte array is a file data.
JSONObject is like this:
ex: {"FileData":[23,21,2,5]}
JSONObject jsonObject = new JSONObject(apidata);
String imagedata = jsonObject.getJSONArray("FileData").toString();
Gson gson = new Gson();
byte[] filebytes = gson.fromJson(imagedata, byte[].class);
Its working fine for small byte array. but if "FileData" is big array then Out Of Memory Error at storing string variable. Please help me how to overcome this problem.