I have this while loop downloading a file
while ((val = bis.read(buffer, 0, 1024)) > 0) {
   out.write(buffer, 0, val);
   fileSize -= val;
   if (fileSize < 1024) {
   val = (int) fileSize;
}
Trying to figure out how to show Mbit/s like many speed sites do.(link)
http://www.speedtest.net/
.   
Would like the mesurment to stay inside the while loop but i have
seen examples using on-minute-threads firing but i dunno..    
I dont know the amount of data, or the data is always 1024.
thats on of the problems i think
Any help is grate?
 
     
     
    