58,454
社区成员
InputStreamReader isr = null;
try {
// copyFile("C:\\Users\\Administrator\\Desktop\\test.txt", "C:\\Users\\Administrator\\Desktop\\test_copy.txt", false);
File file = new File("C:\\Users\\Administrator\\Desktop\\test.txt");
isr = new InputStreamReader(new FileInputStream(file), "utf-8");
char[] chars = new char[1024];
while (isr.read(chars) != -1) {
System.out.println(new String("gbk", chars));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
isr.close();
} catch (IOException e) {
e.printStackTrace();
}
}