1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| BufferedInputStream input = new BufferedInputStream (new FileInputStream (adr_fichier_en_entrée));
BufferedOutputStream out = new BufferedOutputStream (new FileOutputStream (adr_fichier_en_sortie));
byte [] b = new byte [512 * 1024];
int r;
while ((r = input.read (b)) > -1)
out.write (b, 0, r);
try {//try
input.close ();
} catch (IOException ex) {
JOptionPane.showMessageDialog (null, ex);
}
out.flush ();
try {
out.close ();
} catch (IOException ex) {
JOptionPane.showMessageDialog (null, ex.getMessage ().toString (), "Message d'erreur", JOptionPane.ERROR_MESSAGE);
} |
Partager