public static void writeWorkBookToExcel(Workbook workbook, OutputStream os) throws WriteExcelException {
        try {
            workbook.write(os);
        } catch (IOException e) {
            throw new WriteExcelException(e.getMessage());
        }
    }
public static void writeWorkBookToExcel ( Workbook workbook , OutputStream os ) throws WriteExcelException { try { workbook . write ( os ) ; } catch ( IOException e ) { throw new WriteExcelException ( e . getMessage ( ) ) ; } }
将指定WorkBook写入指定文件中

@param workbook 指定工作簿
@param os       指定输出流,需要手动关闭
@throws WriteExcelException 出现I/O异常抛出