首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

输入跟输出流的运用

2012-10-30 
输入和输出流的运用?private static String readFileContent(File file) throws Exception {??BufferedRea

输入和输出流的运用

?private static String readFileContent(File file) throws Exception {??BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));??StringBuffer content = new StringBuffer();????for (String line = null; (line =reader.readLine()) != null; ){???content.append(line).append("\n");??}??return content.toString();?}

?上面是读取文件的的输出流

热点排行