[bug-65609] add flushBufferedData to SXSSFSheet

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893791 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2021-10-01 16:51:12 +00:00
parent b15e441e80
commit 10e607a1ce
2 changed files with 14 additions and 0 deletions

View 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();

View 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.