public function createStreamedResponse(Spreadsheet $spreadsheet, $type, $status = 200, $headers = array(), $writerOptions = array())
    {
        $writer = IOFactory::createWriter($spreadsheet, $type);

        if (!empty($writerOptions)) {
            $this->applyOptionsToWriter($writer, $writerOptions);
        }

        return new StreamedResponse(
            function () use ($writer) {
                $writer->save('php://output');
            },
            $status,
            $headers
        );
    }