读取文件小记

            File file = new File("src/com/test4/util/StringUtil.java");
            FileInputStream in = new FileInputStream(file);
            InputStreamReader reader = new InputStreamReader(in);
            BufferedReader bf = new BufferedReader(reader);
            int i = 0 ;
            while(i!=-1){
                String line = bf.readLine(); 
                 i=bf.read();
            }
 

你可能感兴趣的:(读取文件)