SXSSFWorkbook 转 InputStream「建议收藏」
大家好,又见面了,我是你们的朋友全栈君。
public static InputStream workbookConvertorStream(SXSSFWorkbook workbook) {
InputStream in = null;
//临时缓冲区
ByteArrayOutputStream out = new ByteArrayOutputStream();
//创建临时文件
workbook.write(out);
byte [] bookByteAry = out.toByteArray();
in = new ByteArrayInputStream(bookByteAry);