码迷,mamicode.com
首页 > 移动开发 > 详细

Android(三)文件流操作读写

时间:2016-03-12 19:55:29      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:

1、将字符串写入文件流中。使用的是getFilesDir()。存到手机内存中。

技术分享
File file = new File(getFilesDir() + "/info.txt");
                    try {
                        OutputStream out = new FileOutputStream(file);
                        out.write(text.getBytes());
                        out.close();
                    } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
View Code

 

Android(三)文件流操作读写

标签:

原文地址:http://www.cnblogs.com/wswbk/p/5269829.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!