Hi zizou77!
> how you can couting input/ouput stream.
> it's with commons-vfs?
>   
No, you just create your own CountingInputStream, maybe best by inherit
from FilterInputStream, override the read(...) methods and add the
number of bytes read to a counter.
On the first read(...) you store the System.currentTimeMillis() and
later you can use both informations (nuof read bytes and time) to
calculate a bandwith.

The same goes for OutputStream.

Best is you create another class, say "BandwithManager" where the nuof
bytes and the start time lives, maybe separated by read/write or both.
You pass an instance of your BandwithManager to the constructor of your
Counting*Stream and then you can have e.g.
BandwithManager.getInputBandwith(), BandwithManager.getOutputBandwith(),
BandwithManager.getTotalBandwith()

Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to