读文件

File file = new File(path);
if (file.exists()){
    try {
        BufferedReader bfr = new BufferedReader(new FileReader(path));
        String line = bfr.readLine();
        while (line != null) {
            line = bfr.readLine();
        }
        bfr.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

猜你喜欢

转载自blog.csdn.net/yongwoozzang/article/details/80733699
今日推荐