From ecf4ed552274f6ce4bfc558884ed1be7fc16c113 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Sun, 13 Apr 2008 07:36:00 +0000 Subject: [PATCH] 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 --- .../apache/fop/util/CloseBlockerOutputStream.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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(); -- 2.39.5