1.maven
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
2.具體小例子
public static void main(String[] args) throws Exception {
InputStream in = new URL("http://commons.apache.org").openStream();
try {
System.out.println(IOUtils.toString(in));
} finally {
IOUtils.closeQuietly(in);
}
}
3.總結(jié)
Commons-IO 包括 工具類 (utility classes), 字節(jié)序列類 (endian classes), 行迭代器 (line iterator), 文件過(guò)濾器 (file filters),文件比較器 (file comparators) 和 流實(shí)現(xiàn) (stream implementations)泛释。還是那句話滤愕,如果用到對(duì)流的操作,可以研究研究這里的API
官網(wǎng)地址:http://commons.apache.org/proper/commons-io/index.html
并發(fā)編程網(wǎng) - ifeve.com:http://ifeve.com/commons-io/