You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
969 B
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

## 常用的一些工具及工具类的使用
### 1 Excel文件处理
#### 1.1 Apache poi、jxl 的缺陷
- 代码实现过于复杂
- Apache poi、jxl 都存在生成 excel 文件不够简单优雅快速外,它们都还存在一个严重的问题,那就是非常耗内存,严重时会导致内存溢出
- 开发者们大部分使用 POI都是使用其 userModel 模式
- 然而 userModel 模式最大的问题是在于,对内存消耗非常大,一个几兆的文件解析甚至要用掉上百兆的内存
- 并发上来后一定会OOM或者频繁的 full gc
#### 1.2 EasyExcel 解决了什么
- 传统 Excel 框架,如 Apache poi、jxl 都存在内存溢出的问题
- 传统 excel 开源框架使用复杂、繁琐
- EasyExcel 底层还是使用了 poi, 但是做了很多优化,如修复了并发情况下的一些 bug, 具体修复细节可阅读官方文档https://github.com/alibaba/easyexcel
#### 1.3 使用步骤
- 导入依赖
- 写代码