You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Manuel Domínguez Alvera <ad...@progmaq.com> on 2009/02/17 21:41:09 UTC
How to get the bytes transferred during a download?
I need to get the bytes transferred while download a file, I'm using
"Threads" and I'm interested to know the number of bytes downloaded,
before the download.
How can I do? Any example? Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: How to get the bytes transferred during a download?
Posted by Marcel Schiffel <ma...@googlemail.com>.
Hi,
I think exactly the same problem has been discussed in an earlier thread:
http://www.nabble.com/visualizing-upload-download-status-in-a-statusbar-to19685137.html#a20507255.
Please post your solution!
Thanks
Marcel
2009/3/11 Eugeny N Dzhurinsky <bo...@redwerk.com>
> On Wed, Feb 18, 2009 at 03:05:24PM +0100, Manuel Domínguez Alvera wrote:
> > But how can I count the bytes that have been transferred? What Class?
> > What Method?
>
> We used custom socket factories, whose return a subclass of Socket, capable
> of
> returning an instance of Stream, counting bytes read from an underlying
> stream. So we were able to calculate throughput.
>
> You will need to create the custom socket factory and simply pass it to
> appropriate protocol in HttpClient. Please take care of this (sources/docs)
> and if you would still have any questions - come back and ask ;)
>
> Hope that helps.
>
> --
> Eugene N Dzhurinsky
>
Re: How to get the bytes transferred during a download?
Posted by Eugeny N Dzhurinsky <bo...@redwerk.com>.
On Wed, Feb 18, 2009 at 03:05:24PM +0100, Manuel Domínguez Alvera wrote:
> But how can I count the bytes that have been transferred? What Class?
> What Method?
We used custom socket factories, whose return a subclass of Socket, capable of
returning an instance of Stream, counting bytes read from an underlying
stream. So we were able to calculate throughput.
You will need to create the custom socket factory and simply pass it to
appropriate protocol in HttpClient. Please take care of this (sources/docs)
and if you would still have any questions - come back and ask ;)
Hope that helps.
--
Eugene N Dzhurinsky
Re: How to get the bytes transferred during a download?
Posted by Manuel Domínguez Alvera <ad...@progmaq.com>.
But how can I count the bytes that have been transferred? What Class?
What Method?
Thanks!
Oleg Kalnichevski escribió:
> Manuel Domínguez Alvera wrote:
>> I need to get the bytes transferred while download a file, I'm using
>> "Threads" and I'm interested to know the number of bytes downloaded,
>> before the download.
>> How can I do?
>
> You need to count them.
>
> Oleg
>
>
> Any example? Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: How to get the bytes transferred during a download?
Posted by Oleg Kalnichevski <ol...@apache.org>.
Manuel Domínguez Alvera wrote:
> I need to get the bytes transferred while download a file, I'm using
> "Threads" and I'm interested to know the number of bytes downloaded,
> before the download.
> How can I do?
You need to count them.
Oleg
Any example? Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org