]> source.dussan.org Git - poi.git/commitdiff
[bug-65609] add flushBufferedData to SXSSFSheet
authorPJ Fanning <fanningpj@apache.org>
Fri, 1 Oct 2021 16:51:12 +0000 (16:51 +0000)
committerPJ Fanning <fanningpj@apache.org>
Fri, 1 Oct 2021 16:51:12 +0000 (16:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893791 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java
poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java

index f782a9a554c4d85a713544cdc9ca98a1b822c3c1..88a6619b27a57f79bfaaf0aad925d739277c967a 100644 (file)
@@ -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();
index 973a93762e30b4c252e261361b1b6f358fcfdd7a..490798adf0fe0c338b68eb841186ce56a800cd21 100644 (file)
@@ -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.