You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Jonathan Bayle <jo...@gael.fr> on 2014/07/22 15:29:32 UTC

Stream big files

Hi all,

Thanks for all your answers so far.

My OData service has to serve big files ( 1~2 GB ), how can I stream these  
files through a BufferedSteam ? (with hasStream="true" and $value).

Thanks,
Jonathan.

Re: Stream big files

Posted by "Bolz, Michael" <mi...@sap.com>.
Hi Jonathan,

The Answer to this question belongs a lot on the way how you provide the data from the big file.
In general you can you can attach any implementation of an InputStream to the ODataResponse object (as return of e.g. "EntityMediaProcessor.readEntityMedia(..)" ).
For your case you can then attach the BufferedStream. But I don't know if the BufferedStream support this use case or if you need your own (or another) InputStream implementation.
Additional your JEE Application/Servlet Server (e.g. Tomcat) must support "Transfer-Encoding: chunked".

For a manual test of such a use case we have written an InputStream which dynamically generates data, attached it to a ODataRespone and run this on a Tomcat which has worked as expected.

Kind regards,
Michael


On 22.07.2014, at 15:29, Jonathan Bayle <jo...@gael.fr> wrote:

> Hi all,
> 
> Thanks for all your answers so far.
> 
> My OData service has to serve big files ( 1~2 GB ), how can I stream these files through a BufferedSteam ? (with hasStream="true" and $value).
> 
> Thanks,
> Jonathan.