首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

读入跟写入内存

2012-09-05 
读入和写入内存引用来的没有亲测 备用吧FileOutputStream fos openFileOutput(urls.txt, Context.MODE

读入和写入内存

引用来的没有亲测 备用吧

FileOutputStream fos = openFileOutput("urls.txt", Context.MODE_PRIVATE);?
fos.write("Alex".getBytes());?
fos.close();?

?

FileInputStream fis = openFileInput("urls.txt");?
int c;?
while((c=fis.read())!=-1)?
? ? ? ? {?
?
? ? ? ? ? ? k += (char)c;?
? ? ? ? }?
fis.close();?
http://developer.android.com/guide/topics/data/data-storage.html#filesInternal

热点排行