mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 23:42:53 +08:00
Changing the Android
This commit is contained in:
parent
3c9d8261f2
commit
cccce01415
@ -92,12 +92,25 @@ public class FileUtils {
|
|||||||
|
|
||||||
public int write(String filename, String data)
|
public int write(String filename, String data)
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
int i=0;
|
||||||
|
String FilePath="/sdcard/" + filename;
|
||||||
try {
|
try {
|
||||||
FileOutputStream out = new FileOutputStream(filename);
|
ByteArrayInputStream in = new ByteArrayInputStream(data.getBytes());
|
||||||
PrintStream p = new PrintStream(out);
|
byte buff[] = new byte[1024];
|
||||||
p.print(data);
|
FileOutputStream out=
|
||||||
} catch (FileNotFoundException e) {
|
new FileOutputStream(FilePath);
|
||||||
return -1;
|
do {
|
||||||
|
int numread = in.read(buff);
|
||||||
|
if (numread <= 0)
|
||||||
|
break;
|
||||||
|
out.write(buff, 0, numread);
|
||||||
|
System.out.println("numread" + numread);
|
||||||
|
i++;
|
||||||
|
} while (true);
|
||||||
|
out.flush();
|
||||||
|
out.close();
|
||||||
|
} catch (Exception e) { e.printStackTrace(); }
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user