fix readBySax stream bug

This commit is contained in:
Looly
2020-11-18 00:54:46 +08:00
parent 9867333f68
commit 8d1ab0173a
3 changed files with 11 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package cn.hutool.poi.excel.test;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.StrUtil;
import cn.hutool.poi.excel.ExcelUtil;
@@ -31,6 +32,12 @@ public class ExcelSaxReadTest {
ExcelUtil.readBySax("aaa.xlsx", 0, createRowHandler());
}
@Test
public void excel07FromStreamTest() {
// issue#1225 非markSupport的流读取会错误
ExcelUtil.readBySax(IoUtil.toStream(FileUtil.file("aaa.xlsx")), 0, createRowHandler());
}
@Test
public void excel03Test() {
Excel03SaxReader reader = new Excel03SaxReader(createRowHandler());