文件输出流--存储进去
FileOutputStream fos= null;
fos = context.openFileOutput(filename, Context.MODE_PRIVATE);fos.write(filecontent.getBytes("UTF-8"));
fos.close();
默认位置 /data/data/package/file
文件输入流-提取数据
FileInputStream in = null;
ByteArrayOutputStream bout = null;
byte[]buf = new byte[1024];
bout = new ByteArrayOutputStream();
int length = 0;
//得到输入流
in = context.openFileInput(filename);
while((length=in.read(buf))!=-1){
bout.write(buf,0,length);
}
byte[] content = bout.toByteArray();
//设置文本框为读取内容
filecontentEt.setText(new String(content,"UTF-8"));
in.close();
bout.close();