SXSSFWorkbook 转 InputStream

public static InputStream workbookConvertorStream(SXSSFWorkbook workbook) {
    InputStream in = null;
    try{
        //临时缓冲区
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        //创建临时文件
        workbook.write(out);
        byte [] bookByteAry = out.toByteArray();
        in = new ByteArrayInputStream(bookByteAry);
    }
    catch (Exception e){
        e.printStackTrace();
    }
    return in;
}

你可能感兴趣的:(工作记录,InputStream,SXSSFWorkbook)