You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Stefan Schuster <ss...@pironet-ndh.com> on 2005/09/15 10:41:18 UTC

Attachment Stream is read twice

Hello,

when I create an attachemt and add it to the message
Message.createAttachmentPart... Message.addAttachmentPart...
The Stream set in the DataSource is requested twice
from the DataSource. 

This is an problem because the stream cannot be reset (FileInputStream)
and I dont want to buffer the whole file to be able to
return a new stream whenever the StreamSources 
getStream() method is called.

Any suggestions?

Thanks in advance,

Stefan

Re: Attachment Stream is read twice

Posted by Davanum Srinivas <da...@gmail.com>.
Use CommonsHTTPSender, stream will be queried only once.

On 9/15/05, Stefan Schuster <ss...@pironet-ndh.com> wrote:
> Hello,
> 
> when I create an attachemt and add it to the message
> Message.createAttachmentPart... Message.addAttachmentPart...
> The Stream set in the DataSource is requested twice
> from the DataSource.
> 
> This is an problem because the stream cannot be reset (FileInputStream)
> and I dont want to buffer the whole file to be able to
> return a new stream whenever the StreamSources
> getStream() method is called.
> 
> Any suggestions?
> 
> Thanks in advance,
> 
> Stefan
> 
> 


-- 
Davanum Srinivas : http://wso2.com/ - Oxygenating The Web Service Platform