public String viewWord() {
String filePath = "E:/1111.txt";
BufferedReader br = null;
List<String> lines = new LinkedList<String>();
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), "GBK"));
String line = br.readLine();
while (line != null) {
lines.add(line);
line = br.readLine();
}
} catch (Exception e) {
} finally {
try {
br.close();
for (int i = 0, len = lines.size(); i < len; i++) {
System.out.println(lines.get(i));
}
} catch (IOException e) {
e.printStackTrace();
}
}
return "";
}
String filePath = "E:/1111.txt";
BufferedReader br = null;
List<String> lines = new LinkedList<String>();
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), "GBK"));
String line = br.readLine();
while (line != null) {
lines.add(line);
line = br.readLine();
}
} catch (Exception e) {
} finally {
try {
br.close();
for (int i = 0, len = lines.size(); i < len; i++) {
System.out.println(lines.get(i));
}
} catch (IOException e) {
e.printStackTrace();
}
}
return "";
}