diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-10-01 16:51:12 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-10-01 16:51:12 +0000 |
commit | 10e607a1ce5133f75f9ef46ed5fa75c451eec4a4 (patch) | |
tree | 6638fbe9d6b414e9268dfb343bf1dc61c50dae36 | |
parent | b15e441e8079f6a599de3ebc84187cdb818fa51f (diff) | |
download | poi-10e607a1ce5133f75f9ef46ed5fa75c451eec4a4.tar.gz poi-10e607a1ce5133f75f9ef46ed5fa75c451eec4a4.zip |
[bug-65609] add flushBufferedData to SXSSFSheet
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893791 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java | 10 | ||||
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index f782a9a554..88a6619b27 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -1873,6 +1873,16 @@ public class SXSSFSheet implements Sheet this.flushRows(0); } + /** + * Flush all the data in the buffered stream to the temp file. + * + * @throws IOException If an I/O error occurs + */ + public void flushBufferedData() throws IOException + { + this._writer.flush(); + } + private void flushOneRow() throws IOException { Integer firstRowNum = _rows.firstKey(); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java index 973a93762e..490798adf0 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java @@ -443,6 +443,10 @@ public class SheetDataWriter implements Closeable { return c < ' ' || ('\uFFFE' <= c && c <= '\uFFFF'); } + void flush() throws IOException { + this._out.flush(); + } + /** * Deletes the temporary file that backed this sheet on disk. * @return true if the file was deleted, false if it wasn't. |