From: Jeremias Maerki Date: Sun, 13 Apr 2008 07:36:00 +0000 (+0000) Subject: Performance improvement when encoding images: Fixed an important hotspot by extending... X-Git-Tag: fop-0_95~47 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ecf4ed552274f6ce4bfc558884ed1be7fc16c113;p=xmlgraphics-fop.git 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). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95@647537 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/util/CloseBlockerOutputStream.java b/src/java/org/apache/fop/util/CloseBlockerOutputStream.java index 7192e76d2..c0db8c8b7 100644 --- a/src/java/org/apache/fop/util/CloseBlockerOutputStream.java +++ b/src/java/org/apache/fop/util/CloseBlockerOutputStream.java @@ -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();