android的通过context对象读取私有文件

来源:互联网 发布:ansys软件配置要求 编辑:程序博客网 时间:2024/06/18 16:03



//通过context对象获取一个私有目录的文件读取流  /data/data/packagename/files/userinfoi.txt

FileInputStream fileInputStream = context.openFileInput("userinfo.txt");


//通过context对象得到私有目录下一个文件写入流; name : 私有目录文件的名称    mode: 文件的操作模式, 私有,追加,全局读,全局写
FileOutputStream fileOutputStream = context.openFileOutput("userinfo.txt", Context.MODE_PRIVATE);



FileInputStream inputStream = context.openFileInput("userinfo.txt");

0 0
原创粉丝点击