标签:
/** * 按流读取文件 * @param path * @return * @throws FileNotFoundException */ public static BufferedReader openFile(final String path) throws FileNotFoundException { FileInputStream in = new FileInputStream(new File(path)); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); return reader; }
一行一行的读取:
read.readLines();
注意:这里返回的不是数组,而是字符串。
标签:
原文地址:http://www.cnblogs.com/yrqiang/p/5343649.html