# Java从BufferedReader一行一行读取数据
经常需要从BufferedReader
读取数据,比如读取csv
文件,就要装到BufferedReader
里然后一行一行处理。
方法一:
BufferedReader buffered = new BufferedReader(reader);
String line;
while ((line = buffered.readLine()) != null) {
System.out.println(line);
}
方法二:
BufferedReader buffered = new BufferedReader(reader);
Stream<String> lines = buffered.lines();