ITeye博客

Apache开源工具包使用汇总

mingren135 · 2013-10-24 15:17 · J2EE · web · 移动开发 · Markdown

1、commons-io,http://commons.apache.org/proper/commons-io/,Commons IO is a library of utilities to assist with developing IO functionality.

//直接将IO流转成字符串 
InputStream in = new URL( "http://jakarta.apache.org" ).openStream();
 try {
   System.out.println( IOUtils.toString( in ) );
 } finally {
   IOUtils.closeQuietly(in);
 }
//读取文本文件的所有行
 File file = new File("/commons/io/project.properties");
 List lines = FileUtils.readLines(file, "UTF-8");

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。