You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Babak Vahdat (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/12/02 14:23:40 UTC

[jira] [Issue Comment Edited] (CAMEL-4687) Wrap FileInputStream in BufferedInputStream in the Converter classes to ensure loading from file is faster

    [ https://issues.apache.org/jira/browse/CAMEL-4687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13161614#comment-13161614 ] 

Babak Vahdat edited comment on CAMEL-4687 at 12/2/11 1:22 PM:
--------------------------------------------------------------

Reading again the ticket description today I assume that your main intention was to check [1] where buffering is indeed already in place, but maybe the reuse of newly introduced IOHelper.decorateXYZ() there as well could be nice.

Other than that I think short naming of the newly provided IOHelper methods (in patch) would be nicer. For example through *overloading* them with the *same name*, something like:

{code}
public static BufferedInputStream buffer(InputStream in)
public static BufferedOutputStream buffer(OutputStream out)
public static BufferedReader buffer(Reader reader)
public static BufferedWriter buffer(Writer writer)
{code}

There're also comments I put on [2]

[1] https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
[2] http://camel.465427.n5.nabble.com/svn-commit-r1209404-in-camel-trunk-camel-core-src-main-java-org-apache-camel-impl-main-java-org-apac-tp5041426p5041639.html
                
      was (Author: bvahdat):
    Reading again the ticket description today I assume that your main intention was to check [1] where buffering is indeed already in place, but maybe the reuse of newly introduced IOHelper.decorateXYZ() there as well could be nice.

Other than that I think naming those newly provided IOHelper methods (in patch) would be nicer. For example through *overloading* them with the *same name*, something like:

{code}
public static BufferedInputStream buffer(InputStream in)
public static BufferedOutputStream buffer(OutputStream out)
public static BufferedReader buffer(Reader reader)
public static BufferedWriter buffer(Writer writer)
{code}

There're also comments I put on [2]

[1] https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
[2] http://camel.465427.n5.nabble.com/svn-commit-r1209404-in-camel-trunk-camel-core-src-main-java-org-apache-camel-impl-main-java-org-apac-tp5041426p5041639.html
                  
> Wrap FileInputStream in BufferedInputStream in the Converter classes to ensure loading from file is faster
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4687
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4687
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.9.0
>
>         Attachments: CAMEL-4687.patch
>
>
> We should check the type converters, when creating a new FileInputStream, that the stream gets wrapped in a BufferedInputStream, to ensure the file is loaded faster, as the buffered stream has an internal buffer.
> See CAMEL-4686

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira