Updated the patch to change the extension of the temp file. Regards
Santosh >From 3e95b1880a04657ec93e5626720b1d40b5487ee4 Mon Sep 17 00:00:00 2001 From: Santosh <[email protected]> Date: Tue, 4 Oct 2011 12:11:23 +0530 Subject: [PATCH] Compress the temporary xml file --- .../org/apache/poi/xssf/streaming/SXSSFSheet.java | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index 8c1b998..567c9e8 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -22,6 +22,8 @@ import java.util.Iterator; import java.util.TreeMap; import java.util.Map; +import java.util.zip.GZIPOutputStream; +import java.util.zip.GZIPInputStream; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellReference; @@ -1284,9 +1286,9 @@ public class SXSSFSheet implements Sheet, Cloneable public SheetDataWriter() throws IOException { - _fd = File.createTempFile("poi-sxxsf-sheet", ".xml"); + _fd = File.createTempFile("poi-sxxsf-sheet-xml", ".gz"); _fd.deleteOnExit(); - _out = new BufferedWriter(new FileWriter(_fd)); + _out = new OutputStreamWriter(new GZIPOutputStream (new FileOutputStream(_fd))); } public int getNumberOfFlushedRows() { @@ -1308,7 +1310,8 @@ public class SXSSFSheet implements Sheet, Cloneable { _out.flush(); _out.close(); - return new FileInputStream(_fd); + + return new GZIPInputStream ( new FileInputStream(_fd)); } /** -- 1.7.6.msysgit.0 =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
