mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-11 00:00:05 +08:00
Android File Util update
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user