title: Dowloading a file on android is larger then the size of the file
body: <p>I'm downloading a video using the below code and maintaining a progress bar to show how much of the download has been completed.</p>
  
  <pre><code>ByteArrayBuffer baf = new ByteArrayBuffer((int)filesize);
  long current = 0;
  long notificationSize = filesize / 100 * 5;
  int notifyCount = 0;
  while ((current = inStream.read()) != -1)
  {
      baf.append((byte) current);
      count += current;
  
      //only process update once for each kb
      if(count &gt; notificationSize * notifyCount)
      {
          notifier.processUpdate(count);
          notifyCount++;;
      }
  
  }
  </code></pre>
  
  <p>The issue i'm running into is the data being returned from the input stream adds up to be more than the file size. Meaning my progress bar completes before the download completes.</p>
  
  <p>For example i'm download a video that has a file size of 1,849,655 bytes, but the count of the download adds to 228,932,955.</p>
  
  <p>Android Progress bars use a percentage of how much of the process is complete. How do i know how much is complete if the total byte count from the download is more than the size of the file.</p>