fr.close(); } /** * 一行一行的读取文件中的数据 * @param filePath * @param fileName * @throws IOException */ public void readLineFile(String filePath,String fileName) throws IOException { FileReader fr = new FileReader(filePath+fileName); BufferedReader br = new BufferedReader(fr); String line = br.readLine(); while(line != null) { System.out.println(line); line = br.readLine(); } br.close(); fr.close(); } }
到这里Java输入数据流就介绍完了 |