Wuolah Free

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package p0;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
*
* @author Usuario
*/
public class copy {

public static void main(String[] args) throws IOException {

if (args.length==2){
FileInputStream in = null;
FileOutputStream out = null;

try {
in = new FileInputStream(args[0]);
out = new FileOutputStream(args[1]);
int c;

while ((c = in.read()) != -1) {


out.write(c);
}
} finally {
if (in != null) {
in.close();
}
if (out != null) {
out.close();
}
}
}
else
System.out.println("Los ficheros no existen.");
}
}

You might also like