Improve remote provisioning buffer handling

This commit is contained in:
Yann Diorcet 2013-05-03 09:59:51 +02:00
parent 0cd3a30291
commit c68eaa7b22

View file

@ -1,6 +1,7 @@
package org.linphone;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@ -38,10 +39,12 @@ public class RemoteProvisioning {
byte[] contents = new byte[1024];
int bytesRead = 0;
String strFileContents = "";
while( (bytesRead = bis.read(contents)) != -1){
strFileContents += new String(contents, 0, bytesRead);
ByteArrayOutputStream fileContents = new ByteArrayOutputStream();
while( (bytesRead = bis.read(contents)) != -1) {
fileContents.write(contents, 0, bytesRead);
}
String strFileContents = fileContents.toString();
Log.i("Download Success");
Log.i(strFileContents);