camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-7325) WrappedInputStream can not extend InputStream
Date Fri, 28 Mar 2014 13:33:15 GMT

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

Willem Jiang commented on CAMEL-7325:
-------------------------------------

For the InputStream, we can not reset stream as we do for the ByteArrayInputStream, because
the stream may be consumed and we cannot reread it again. 
As the the StreamCache can be reset when the message is routed to other processor, so I don't
think we need to worry about reset the stream. Can you give a test case to show what kind
of error you hit?


> WrappedInputStream can not extend InputStream
> ---------------------------------------------
>
>                 Key: CAMEL-7325
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7325
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.12.3
>            Reporter: vedat demir
>            Assignee: Willem Jiang
>            Priority: Minor
>         Attachments: MongoDBConverter.java, MongoDBConverter.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> WrappedInputStream may take InputStream or ByteArrayInputStream in its construction and
we use org.apache.camel.util.IOHelper class for stream operation. Please check the line 173
(in version 2.13.3) in IOHelper. You'll see there is a "if (input instanceof ByteArrayInputStream)
{" statement to treat ByteArrayInputStream in a different way.  Since WrappedInputStream 
extends InputStream class rest of the API can not execute these parts and we may not be able
to read the stream since we need to reset the ByteArrayInputStream before executing the "available()"
method. 
> I've attached two different converter to show the difference. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message