读写存储内外部文本数据

 

读写内部存储的文件数据

FileOutputStream fos = OpenFileOutput(filename,Context.Mode_private);

OutputStreamWriter  osw = new OutputStreamWriter();

osw.write();

osw.flush();

fos.flush();

osw.close();

fos.close();

FileInputStream......

 

 

读写外部存储文件数据  SD卡

menifest文件里write....external.....

获取SD卡路径:File sdcard = Enviroment.getExernalStorageDirectory();

File mfile = new File(sdcard,"This is my file.txt");

if(sdcard.exists()){myfile.createNewFile();FileOutputStream fos = new FileOutputStream(myfile);}//写

File mfile = new file();

if(sdcard.exists()){}//读

 

posted @ 2015-07-31 17:50  鲨鱼的微笑  阅读(201)  评论(0编辑  收藏  举报