You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2008/04/13 09:36:00 UTC

svn commit: r647537 - /xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/util/CloseBlockerOutputStream.java

Author: jeremias
Date: Sun Apr 13 00:36:00 2008
New Revision: 647537

URL: http://svn.apache.org/viewvc?rev=647537&view=rev
Log:
Performance improvement when encoding images: Fixed an important hotspot by extending CloseBlocker from ProxyOutputStream instead of FilterOutputStream as the latter routes all write(byte[]) calls through write(int).

Modified:
    xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/util/CloseBlockerOutputStream.java

Modified: xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/util/CloseBlockerOutputStream.java?rev=647537&r1=647536&r2=647537&view=diff
==============================================================================
--- xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/util/CloseBlockerOutputStream.java (original)
+++ xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/util/CloseBlockerOutputStream.java Sun Apr 13 00:36:00 2008
@@ -19,25 +19,25 @@
  
 package org.apache.fop.util;
 
-import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 
+import org.apache.commons.io.output.ProxyOutputStream;
+
 /**
  * This is a decorator to block calls to close() to the underlying stream.
  */
-public class CloseBlockerOutputStream extends FilterOutputStream {
+public class CloseBlockerOutputStream extends ProxyOutputStream {
 
     /**
-     * @see java.io.FilterOutputStream#FilterOutputStream(OutputStream)
+     * Main constructor.
+     * @param out the underlying stream
      */
     public CloseBlockerOutputStream(OutputStream out) {
         super(out);
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public void close() throws IOException {
         try {
             flush();



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