commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Curdt" <tcu...@apache.org>
Subject Re: commons-vfs and bandwidth
Date Mon, 16 Oct 2006 10:39:25 GMT
> > 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.

Actually there some in IO already

http://jakarta.apache.org/commons/io/api-release/org/apache/commons/io/input/CountingInputStream.html

cheers
--
Torsten

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


Mime
View raw message