commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Christian <robertjchrist...@gmail.com>
Subject Re: [fileupload] Need help for Streaming API processing
Date Tue, 14 Apr 2009 16:32:03 GMT
To stream the request to a byte array, you need to first stream it to  
a byte array outputstream, then call getBytes().  This is generally a  
bad idea though since it causes the entire file to be loaded into  
memory.  See if the api requiring the byte array (may be your own  
code) can take the stream directly instead.

Cheers.


On Apr 14, 2009, at 9:22 AM, "Vaibhav@Nabble"  
<vaibhav_k_4u@yahoo.co.in> wrote:

>
> I am having same issue , can you please provide answers for below  
> questions
> ?:-((
>
>
> leenadiwan wrote:
>>
>> Hello All,
>>
>> Im trying to use the streaming API for file upload.
>>
>> I have taken the code sample from the site's "Stream API" section and
>> already have the basic steps.
>>
>> I need the file to be uploaded available as a byte[].
>>
>> I need code sample for
>> 1. converting an InputStream into byte[] if anyone has already done  
>> that.
>> 2. before using this streaming API I used to get the fileSize by a  
>> metod
>> called item.size()
>> Which is the corresponding method in the streaming API?
>>
>> Regards,
>> Leena
>>
>>
>> ---------------------------------
>> Get your own web address.
>> Have a HUGE year through Yahoo! Small Business.
>>
>
> -- 
> View this message in context: http://www.nabble.com/-fileupload--Need-help-for-Streaming-API-processing-tp9618475p23042789.html
> Sent from the Commons - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message