SD卡读写文件
2015-12-09 10:07
302 查看
try {
File f = new File(
android.os.Environment.getExternalStorageDirectory()
+ "/aaa.txt");
String str = "this is a test about Write SD card file";
FileOutputStream fileOS = new FileOutputStream(f);
fileOS.write(str.getBytes());
fileOS.close();
BufferedWriter buf = new BufferedWriter(new OutputStreamWriter(
fileOS));
buf.write(str, 0, str.length());
buf.flush();
buf.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
File f = new File(
android.os.Environment.getExternalStorageDirectory()
+ "/aaa.txt");
String str = "this is a test about Write SD card file";
FileOutputStream fileOS = new FileOutputStream(f);
fileOS.write(str.getBytes());
fileOS.close();
BufferedWriter buf = new BufferedWriter(new OutputStreamWriter(
fileOS));
buf.write(str, 0, str.length());
buf.flush();
buf.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
相关文章推荐
- JavaScript语言精粹笔记
- http请求响应头信息
- js省市联动效果完整实例代码
- opnet 遇到的语法错误
- How to run 32-bit app in Ubuntu 64-bit?
- 实用网址收录
- 存储过程查找表中的内容去匹配另一张表中对应的数据,将该表查找到的数据插入到另一张表中
- 使用label解析html字符串
- javascript预编译
- freemarker中间split字符串切割
- ubuntu 14.0.4下安装有道字典
- java入门练习题三
- mini2440_x35 ubuntu下使用dnw进行传送文件
- Android文字测量与绘制的两个注意点
- CSS控制文本自动换行
- css3媒体查询实现网站响应式布局
- 【转】PowerDesigner使用方法小结
- SVG
- Html.RenderPartial和Html.RenderAction的区别
- 夺命雷公狗---javascript NO:22 对象在内存中的表现形式