On Tue, 4 Oct 2011, Santosh Kharolkar wrote:
Updated the patch to change the extension of the temp file.

Any chance you could open a new bug in bugzilla, and upload the patch to that? It'll help us make sure it doesn't get lost/forgotten

Thanks
Nick

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));
        }

        /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to