编程语言
首页 > 编程语言> > java 读文件

java 读文件

作者:互联网

1、

2、

    private static void read(String tempPath) {
        try {
            FileInputStream fin = new FileInputStream(tempPath);
            InputStreamReader reader = new InputStreamReader(fin);
            BufferedReader br = new BufferedReader(reader);
            String linetxt;//22:2022-06-22 21:51:00,2022-06-22 21:52:00
            while ((linetxt = br.readLine()) != null) {
                if ("".equals(linetxt)) continue;
            }
            br.close();
            reader.close();
            fin.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

标签:文件,java,linetxt,22,br,reader,close,new
来源: https://www.cnblogs.com/kikyoqiang/p/16403298.html