aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/image/ImageFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/image/ImageFactory.java')
-rw-r--r--src/java/org/apache/fop/image/ImageFactory.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/image/ImageFactory.java b/src/java/org/apache/fop/image/ImageFactory.java
index 1060144fd..ce287026d 100644
--- a/src/java/org/apache/fop/image/ImageFactory.java
+++ b/src/java/org/apache/fop/image/ImageFactory.java
@@ -281,8 +281,12 @@ public class ImageFactory {
return null;
}
- //Decorate the InputStream with a BufferedInputStream
- return new java.io.BufferedInputStream(in);
+ //Make sure the InputStream is decorated with a BufferedInputStream
+ if (in instanceof java.io.BufferedInputStream) {
+ return in;
+ } else {
+ return new java.io.BufferedInputStream(in);
+ }
} catch (Exception e) {
log.error("Error while opening stream for ("
+ href + "): " + e.getMessage(), e);