hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: sending/streaming audio data using chunked encoding
Date Wed, 22 Sep 2010 15:18:05 GMT
On Tue, 2010-09-21 at 21:27 +0100, sebb wrote:
> On 21 September 2010 20:03, nitin singh <xmlprgrm@gmail.com> wrote:
> > Thanks Sebb for replying to my question. I had already gone though that
> > example. Can you be a little more specific?
> > - As I said I need to write data from a buffer when it gets available.
> > So I need a OutputStream while the example you mention below builds from an
> > InputStreamEntity.
> 
> AIUI, you don't write to the output - HttpClient reads from the
> InputStream when it wants more data.
> 
> One way to do this is to create an InputStream that reads from your buffer.
> 
> If the buffer is not ready, return 0 bytes.
> 
> At end, return -1.
> 

Another way is build a custom HttpEntity that generates content
dynamically and writes it out to OutputStream instance passed to the
HttpEntity#writeOut() method without providing an implementation for the
HttpEntity#getContnent().

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message