package com.qmth.teachcloud.common.util.excel.model;

import java.io.IOException;
import java.io.OutputStream;

import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;

import com.qmth.teachcloud.common.util.excel.ExcelWriterDynamic;

public class XlsxWriter extends ExcelWriterDynamic {

    private SXSSFWorkbook workbook;

    public XlsxWriter() {
        this.workbook = new SXSSFWorkbook(100);
    }

    @Override
    public Workbook getWorkbook() {
        return workbook;
    }

    @Override
    public void output(OutputStream ous) throws IOException {
        super.output(ous);
        workbook.dispose();
    }
}
