Package org.apache.poi.xssf.streaming
Class StreamingSheetWriter
java.lang.Object
org.apache.poi.xssf.streaming.SheetDataWriter
org.apache.poi.xssf.streaming.StreamingSheetWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
Unlike SheetDataWriter, this writer does not create a temporary file, it writes data directly
to the provided OutputStream.
- Since:
- 5.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()flush and close the temp data writer.Create a temp file to write sheet data.createWriter(File fd) Create a writer for the sheet data.Methods inherited from class org.apache.poi.xssf.streaming.SheetDataWriter
getLastFlushedRow, getLowestIndexOfFlushedRows, getNumberOfCellsOfLastFlushedRow, getNumberOfFlushedRows, writeCell, writeRow
-
Constructor Details
-
StreamingSheetWriter
- Throws:
IOException
-
StreamingSheetWriter
- Throws:
IOException
-
-
Method Details
-
createTempFile
Description copied from class:SheetDataWriterCreate a temp file to write sheet data. By default, temp files are created in the default temporary-file directory with a prefix "poi-sxssf-sheet" and suffix ".xml". Subclasses can override it and specify a different temp directory or filename or suffix, e.g..gz- Overrides:
createTempFilein classSheetDataWriter- Returns:
- temp file to write sheet data
- Throws:
IOException
-
createWriter
Description copied from class:SheetDataWriterCreate a writer for the sheet data.- Overrides:
createWriterin classSheetDataWriter- Parameters:
fd- the file to write to- Throws:
IOException
-
close
Description copied from class:SheetDataWriterflush and close the temp data writer. This method must be invoked before callingSheetDataWriter.getWorksheetXMLInputStream()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSheetDataWriter- Throws:
IOException
-
getWorksheetXMLInputStream
- Overrides:
getWorksheetXMLInputStreamin classSheetDataWriter- Returns:
- a stream to read temp file with the sheet data
- Throws:
IOException
-