mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-16 16:51:02 +08:00
Android File Util update
This commit is contained in:
parent
d1db422ccf
commit
0b9ea56fc1
@ -101,7 +101,7 @@ public class FileUtils {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int write(String filename, String data)
|
public int write(String filename, String data, boolean append)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
String FilePath="/sdcard/" + filename;
|
String FilePath="/sdcard/" + filename;
|
||||||
@ -109,7 +109,7 @@ public class FileUtils {
|
|||||||
ByteArrayInputStream in = new ByteArrayInputStream(data.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(data.getBytes());
|
||||||
byte buff[] = new byte[1024];
|
byte buff[] = new byte[1024];
|
||||||
FileOutputStream out=
|
FileOutputStream out=
|
||||||
new FileOutputStream(FilePath, true);
|
new FileOutputStream(FilePath, append);
|
||||||
do {
|
do {
|
||||||
int numread = in.read(buff);
|
int numread = in.read(buff);
|
||||||
if (numread <= 0)
|
if (numread <= 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user