package com.ycl.utils; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.read.builder.ExcelReaderBuilder; import com.alibaba.excel.read.builder.ExcelReaderSheetBuilder; import lombok.extern.slf4j.Slf4j; import java.io.InputStream; import java.util.List; @Slf4j public class ExcelUtils { public static List getExcelModelData(final InputStream inputStream, Class clazz) { if (null == inputStream) { throw new NullPointerException("the inputStream is null!"); } ExcelReaderBuilder result = EasyExcel.read(inputStream, clazz, null); ExcelReaderSheetBuilder sheet1 = result.sheet(); List resultData = sheet1.doReadSync(); return resultData; } }