You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2016/07/17 20:25:37 UTC

svn commit: r1753112 - in /poi/trunk/src: java/org/apache/poi/POIDocument.java java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java ooxml/java/org/apache/poi/POIXMLDocument.java scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java

Author: onealj
Date: Sun Jul 17 20:25:37 2016
New Revision: 1753112

URL: http://svn.apache.org/viewvc?rev=1753112&view=rev
Log:
bug 57919: add performance note to javadocs about using BufferedOutputStreams on Document.write(OutputStream) if underlying resource is high latency

Modified:
    poi/trunk/src/java/org/apache/poi/POIDocument.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
    poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java

Modified: poi/trunk/src/java/org/apache/poi/POIDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/POIDocument.java?rev=1753112&r1=1753111&r2=1753112&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/POIDocument.java (original)
+++ poi/trunk/src/java/org/apache/poi/POIDocument.java Sun Jul 17 20:25:37 2016
@@ -313,6 +313,11 @@ public abstract class POIDocument implem
      * Note - if the Document was opened from a {@link File} rather
      *  than an {@link InputStream}, you <b>must</b> write out to
      *  a different file, overwriting via an OutputStream isn't possible.
+     *  
+     * If {@code stream} is a {@link java.io.FileOutputStream} on a networked drive
+     * or has a high cost/latency associated with each written byte,
+     * consider wrapping the OutputStream in a {@link java.io.BufferedOutputStream}
+     * to improve write performance.
      * 
      * @param out The stream to write to.
      * 

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java?rev=1753112&r1=1753111&r2=1753112&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java Sun Jul 17 20:25:37 2016
@@ -1327,6 +1327,11 @@ public final class HSSFWorkbook extends
      * Method write - write out this workbook to an {@link OutputStream}.  Constructs
      * a new POI POIFSFileSystem, passes in the workbook binary representation  and
      * writes it out.
+     * 
+     * If {@code stream} is a {@link java.io.FileOutputStream} on a networked drive
+     * or has a high cost/latency associated with each written byte,
+     * consider wrapping the OutputStream in a {@link java.io.BufferedOutputStream}
+     * to improve write performance.
      *
      * @param stream - the java OutputStream you wish to write the XLS to
      *

Modified: poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java?rev=1753112&r1=1753111&r2=1753112&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java Sun Jul 17 20:25:37 2016
@@ -214,6 +214,11 @@ public abstract class POIXMLDocument ext
      * Note - if the Document was opened from a {@link File} rather
      *  than an {@link InputStream}, you <b>must</b> write out to
      *  a different file, overwriting via an OutputStream isn't possible.
+     *  
+     * If {@code stream} is a {@link java.io.FileOutputStream} on a networked drive
+     * or has a high cost/latency associated with each written byte,
+     * consider wrapping the OutputStream in a {@link java.io.BufferedOutputStream}
+     * to improve write performance.
      * 
      * @param stream - the java OutputStream you wish to write the file to
      *

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java?rev=1753112&r1=1753111&r2=1753112&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java Sun Jul 17 20:25:37 2016
@@ -79,7 +79,7 @@ import org.apache.poi.util.Internal;
  */
 public final class HWPFDocument extends HWPFDocumentCore
 {
-    static final String PROPERTY_PRESERVE_BIN_TABLES = "org.apache.poi.hwpf.preserveBinTables";
+    /*package*/ static final String PROPERTY_PRESERVE_BIN_TABLES = "org.apache.poi.hwpf.preserveBinTables";
     private static final String PROPERTY_PRESERVE_TEXT_TABLE = "org.apache.poi.hwpf.preserveTextTable";
 
     private static final String STREAM_DATA = "Data";
@@ -583,6 +583,11 @@ public final class HWPFDocument extends
 
   /**
    * Writes out the word file that is represented by an instance of this class.
+   * 
+   * If {@code stream} is a {@link java.io.FileOutputStream} on a networked drive
+   * or has a high cost/latency associated with each written byte,
+   * consider wrapping the OutputStream in a {@link java.io.BufferedOutputStream}
+   * to improve write performance.
    *
    * @param out The OutputStream to write to.
    * @throws IOException If there is an unexpected IOException from the passed



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org