Android输出流创建txt文件例子。执行代码如下:
java执行代码如下
public void privateMode(View v) throws Exception {
FileOutputStream fos = openFileOutput("private.txt",MODE_PRIVATE);
fos.write("private".getBytes());
fos.close();
}
public void append(View v) throws Exception {
FileOutputStream fos = openFileOutput("append.txt",MODE_APPEND);
fos.write("append".getBytes());
fos.close();
}