Improve remote provisioning buffer handling
This commit is contained in:
parent
0cd3a30291
commit
c68eaa7b22
1 changed files with 6 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
package org.linphone;
|
package org.linphone;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
@ -38,10 +39,12 @@ public class RemoteProvisioning {
|
||||||
byte[] contents = new byte[1024];
|
byte[] contents = new byte[1024];
|
||||||
|
|
||||||
int bytesRead = 0;
|
int bytesRead = 0;
|
||||||
String strFileContents = "";
|
ByteArrayOutputStream fileContents = new ByteArrayOutputStream();
|
||||||
while( (bytesRead = bis.read(contents)) != -1){
|
while( (bytesRead = bis.read(contents)) != -1) {
|
||||||
strFileContents += new String(contents, 0, bytesRead);
|
fileContents.write(contents, 0, bytesRead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String strFileContents = fileContents.toString();
|
||||||
Log.i("Download Success");
|
Log.i("Download Success");
|
||||||
Log.i(strFileContents);
|
Log.i(strFileContents);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue