camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1202662 - in /camel/branches/camel-2.8.x: ./ camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
Date Wed, 16 Nov 2011 12:27:31 GMT
Author: davsclaus
Date: Wed Nov 16 12:27:30 2011
New Revision: 1202662

URL: http://svn.apache.org/viewvc?rev=1202662&view=rev
Log:
CAMEL-4686: Using buffered input stream for file input stream cache. Thanks to Metatech for
the patch.

Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 16 12:27:30 2011
@@ -1 +1 @@
-/camel/trunk:1202148,1202167,1202204-1202206,1202215,1202223
+/camel/trunk:1202148,1202167,1202204-1202206,1202215,1202223,1202659

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java?rev=1202662&r1=1202661&r2=1202662&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
(original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
Wed Nov 16 12:27:30 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.converter.stream;
 
+import java.io.BufferedInputStream;
 import java.io.Closeable;
 import java.io.File;
 import java.io.FileInputStream;
@@ -34,7 +35,7 @@ public class FileInputStreamCache extend
 
     public FileInputStreamCache(File file) throws FileNotFoundException {
         this.file = file;
-        this.stream = new FileInputStream(file);
+        this.stream = new BufferedInputStream(new FileInputStream(file));
     }
     
     @Override
@@ -50,7 +51,7 @@ public class FileInputStreamCache extend
             // reset by closing and creating a new stream based on the file
             close();
             // reset by creating a new stream based on the file
-            stream = new FileInputStream(file);
+            stream = new BufferedInputStream(new FileInputStream(file));
         } catch (Exception e) {
             throw new RuntimeCamelException("Cannot reset stream from file " + file, e);
         }            



Mime
View raw message