文件读写
来源:互联网 发布:什么是云计算服务器 编辑:程序博客网 时间:2024/06/12 20:14
public static void initHoliday(Context context) { String strPath = "/data/data/" + context.getPackageName() + "/shared_prefs/"; String strFileName = "holiday.xml"; if (!(new File(strPath + strFileName)).exists()) { File f = new File(strPath); if (!f.exists()) { f.mkdir(); } try { InputStream is = context.getAssets().open(strFileName); OutputStream os = new FileOutputStream(strPath + strFileName); byte[] buffer = new byte[1024 * 64]; int length; while ((length = is.read(buffer)) > 0) { os.write(buffer, 0, length); } os.flush(); os.close(); is.close(); } catch (Exception e) { e.printStackTrace(); } } }
0 0
- 文件读写、剪贴板读写
- 读写文件
- 文件读写
- 读写文件
- 读写文件
- 文件读写
- 读写文件
- 读写文件
- 读写文件
- 文件读写
- 文件读写
- 文件读写
- 文件读写
- 读写文件
- 文件读写
- 文件读写
- 文件读写
- 文件读写
- date命令
- 性能分析工具之-- Eclipse Memory Analyzer tool(MAT)(一)
- Mysql安装时出现APPLY security settings错误
- ubuntu下修改hosts文件
- js之中使用 this 的原因
- 文件读写
- OrmLite的快速使用方案
- spark 不支持 嵌入RDDs or 用户定义的函数 that refer to other RDDs 【未完待续】
- Packet for query is too large (12238 > 1024). You can change this value
- iOS开发之pch
- Linux学习教程(八)系统启动流程
- Utuntu 12.04 LTS 安装ibus
- 性能分析工具之-- Eclipse Memory Analyzer tool(MAT)(二)
- 小技巧