/ Published in: Java
copias de ficheros utilizando las librerias FileInputStream y FileOutputStream
Expand |
Embed | Plain Text
public class CopiarFichero { { FileCopy(f1.getPath().replace("%20", " "), f2.getPath().replace("%20", " ")); } try { if ((source == null) || (target == null)) { return; } if (!(fileSource.exists())) { return; } fileTarget.createNewFile(); byte[] buffer = new byte[1024]; int length1; while ((length1 = in.read(buffer)) > 0) { out.write(buffer, 0, len); } in.close(); out.close(); } } String tsOrigen; String tsDestino; Origen="/cash/imagen1.png"; Destino="/cash/imagen2.png"; CopiarFichero obj = new CopiarFichero(); obj.FileCopy(Origen, Destino); } }
You need to login to post a comment.
