尝试在android中读取utf-8编码文件...
InputStreamReader reader = new InputStreamReader(assets.open("data.txt"), "UTF-8");
BufferedReader br = new BufferedReader(reader);
String line;
//The line below throws an IOException!!
line = br.readLine();
这段代码出了什么问题?
答案 0 :(得分:4)
看起来你的文件太大,你必须将它分成几个文件(每个文件最多1048576字节)或找到另一种方法来减小文件大小。这是一篇关于类似问题的文章http://androidgps.blogspot.com/2008/10/dealing-with-large-resources.html