Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String args[]) {
- File origen = new File("C:\Users\Montse\Documents\NetBeansProjects\Copiar2\hola.txt");
- File destino = new File("C:\Users\Montse\Documents\NetBeansProjects\Copiar2\backupVisibles\hola.txt");
- try {
- InputStream in = new FileInputStream(origen);
- OutputStream out = new FileOutputStream(destino);
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) > 0) {
- out.write(buf, 0, len);
- }
- in.close();
- out.close();
- } catch (IOException ioe){
- ioe.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement