openFd() -- it is probably compressed

把一些资源文件存在assets下用openFd打开文件有些文件会遇到

错误原因是“文件不能打开,可能被压缩了”,
网络搜索了许多,没有发现很好的解决方法。
http://stackoverflow.com/questions/10141251/android-getassets-openfd-and-filenotfoundexception
这个里有个解决方法还不错
InputStream in = context.getAssets().open("openAccess.txt");
InputStreamReader reader = new InputStreamReader(in);

之后你想读写就都可以了

posted on 2014-05-21 16:21  冲锋的路上的兵  阅读(449)  评论(0编辑  收藏  举报