日期:2014-05-20 浏览次数:20786 次
BufferedReader reader = ...; ArrayList<String> list = new ArrayList<String>(); String line = null; while((line = reader.readLine())!=null){ list.add(line); } //all lines in list
------解决方案--------------------
再稍微补充下
[code=Java]
BufferedReader bufr = new BufferedReader(new InputStreamReader(
new FileInputStream( "e:\\upload\\doc.txt "), "gbk "));
String line = null;
ArrayList <String> list = new ArrayList <String> ();
while((line=bufr.readLine())!=null){
list.add(line);
}[/code]