读写存储内外部文本数据

读写内部存储的文件数据

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()){}//读

原文地址:https://www.cnblogs.com/hzwcoming/p/4692833.html