---
title: "Apache开源工具包使用汇总"
author: "mingren135"
date: "2013-10-24T15:17:28Z"
tags: []
categories: ["移动开发"]
slug: "apache"
draft: false
lastmod: "2013-10-24T15:19:13Z"
id: 1963855
url: "https://mingren135.iteye.com/blog/1963855"
---

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

![](http://dl2.iteye.com/upload/attachment/0090/5130/6bbf3fb7-0e77-348c-afb2-1cb0f54ac668.jpg)

```
//直接将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");
```