I have a Web service based on XML-RPC ,I tried to download a large data using this method :
byte[] data = request.getInfo(infoFilter).getDocuments().get(indexDocument).getContent();
When the data is considered as big, the application will cause exception of out of memory ,because some device has a small size cache ,my solution here is to truncate the data in small quantity. I think I need to get inspiref from this code :
FileOutputStream fos = new FileOutputStream(file);
while ((current = bis.read()) != -1) {
fos.write(current);
}
fos.close();
Can anyone has an idea about how can i resolve this issue ?