Package org.apache.poi.xssf.streaming
Class SheetDataWriter
java.lang.Object
org.apache.poi.xssf.streaming.SheetDataWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
GZIPSheetDataWriter,SheetDataWriterWithDecorator,StreamingSheetWriter
Initially copied from BigGridDemo "SpreadsheetWriter".
Unlike the original code which wrote the entire document,
this class only writes the "sheetData" document fragment
so that it was renamed to "SheetDataWriter"
-
Constructor Summary
ConstructorsConstructorDescriptionSheetDataWriter(Writer writer) SheetDataWriter(SharedStringsTable sharedStringsTable) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()flush and close the temp data writer.Deprecated.createWriter(File fd) Deprecated.this method is due to be made non-public, probably protectedintintintintvoidvoidWrite a row to the file
-
Constructor Details
-
SheetDataWriter
- Throws:
IOException
-
SheetDataWriter
- Throws:
IOException
-
-
Method Details
-
createTempFile
Deprecated.useTempFile.createTempFile(String, String)directlyCreate 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- Returns:
- temp file to write sheet data
- Throws:
IOException
-
createWriter
Deprecated.this method is due to be made non-public, probably protectedCreate a writer for the sheet data.- Parameters:
fd- the file to write to- Throws:
IOException
-
close
flush and close the temp data writer. This method must be invoked before callinggetWorksheetXMLInputStream()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getWorksheetXMLInputStream
- Returns:
- a stream to read temp file with the sheet data
- Throws:
IOException
-
getNumberOfFlushedRows
public int getNumberOfFlushedRows() -
getNumberOfCellsOfLastFlushedRow
public int getNumberOfCellsOfLastFlushedRow() -
getLowestIndexOfFlushedRows
public int getLowestIndexOfFlushedRows() -
getLastFlushedRow
public int getLastFlushedRow() -
writeRow
Write a row to the file- Parameters:
rownum- 0-based row numberrow- a row- Throws:
IOException- If an I/O error occurs
-
writeCell
- Throws:
IOException
-
TempFile.createTempFile(String, String)directly