diff --git a/src/org/linphone/RemoteProvisioning.java b/src/org/linphone/RemoteProvisioning.java index 3e35ec137..e654e391c 100644 --- a/src/org/linphone/RemoteProvisioning.java +++ b/src/org/linphone/RemoteProvisioning.java @@ -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);