Guest User

Untitled

a guest
Jan 18th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. int lenghtBytes = 1024 * 1024;
  2. File outFile = this.file.getDossier ();
  3. out = new FileOutputStream (outFile);
  4. this.panel.jProgressBarTransfert.setMaximum (100);
  5. byte [] buffer = new byte [lenghtBytes];
  6. int l;
  7. long bitTransfered = 0;
  8.  
  9. while ((l = in.read (buffer, 0, buffer.length))! = -1) {
  10. out.write (buffer, 0, l); // We write on the disc.
  11. bitTransfered + = l; // Update the number of bits transferred.
  12. this.update (bitTransfered, httpResponse.getEntity (). getContentLength ());
  13. }
  14. in.close ();
Add Comment
Please, Sign In to add comment