Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int lenghtBytes = 1024 * 1024;
- File outFile = this.file.getDossier ();
- out = new FileOutputStream (outFile);
- this.panel.jProgressBarTransfert.setMaximum (100);
- byte [] buffer = new byte [lenghtBytes];
- int l;
- long bitTransfered = 0;
- while ((l = in.read (buffer, 0, buffer.length))! = -1) {
- out.write (buffer, 0, l); // We write on the disc.
- bitTransfered + = l; // Update the number of bits transferred.
- this.update (bitTransfered, httpResponse.getEntity (). getContentLength ());
- }
- in.close ();
Add Comment
Please, Sign In to add comment