java读取txt配置⽂件_txt配置⽂件的读取package cn.file;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileReader;
读取配置文件失败
import java.io.IOException;
import java.io.InputStreamReader;
/**
* 逐⾏读取配置⽂件(.txt类型)
* @author LYWU
*
*/
刘亮华
public class ReadConfig {
public static final void readF1(String filePath) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(filePath)));
for (String line = br.readLine(); line != null; line = br.readLine()) {
System.out.println(line);
}
br.close();
}
public static final void readF2(String filePath) throws IOException {
FileReader fr = new FileReader(filePath);
BufferedReader bufferedreader = new BufferedReader(fr);
李敖儿子
String instring;
while ((instring = adLine().trim()) != null) {
一年级数学下册教学计划if (0 != instring.length()) {
System.out.println(instring);上海社保缴费基数计算
林芮西}
}
fr.close();
}
}