Browse Source

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
tags/fop-0_95
Jeremias Maerki 16 years ago
parent
commit
ecf4ed5522
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      src/java/org/apache/fop/util/CloseBlockerOutputStream.java

+ 6
- 6
src/java/org/apache/fop/util/CloseBlockerOutputStream.java View File

@@ -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();

Loading…
Cancel
Save