|
|
@ -0,0 +1,53 @@ |
|
|
|
import java.io.FileInputStream; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.Scanner; |
|
|
|
|
|
|
|
public class Principal { |
|
|
|
|
|
|
|
private static Scanner teclado = new Scanner(System.in); |
|
|
|
|
|
|
|
public static void main(String[] args) throws InterruptedException { |
|
|
|
|
|
|
|
byte[] array; |
|
|
|
|
|
|
|
String ruta = "C:\\Users\\Dani\\Documents\\2DAM\\Prueba.txt"; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
String respuesta = ""; |
|
|
|
|
|
|
|
FileInputStream leer = new FileInputStream(ruta); |
|
|
|
FileOutputStream escribir =new FileOutputStream("C:\\Users\\Dani\\Documents\\2DAM\\Resultado.txt"); |
|
|
|
array = leer.readAllBytes(); |
|
|
|
System.out.println("Empezando el proceso de copia. Sea paciente por favor."); |
|
|
|
Thread.sleep(1000); |
|
|
|
System.out.println("Ya casi empezamos..."); |
|
|
|
Thread.sleep(1500); |
|
|
|
System.out.println("Ahora si, empezando proceso."); |
|
|
|
System.out.print("("); |
|
|
|
for(int i =0; i<array.length; i++) { |
|
|
|
Thread.sleep(300); |
|
|
|
System.out.print("-"); |
|
|
|
escribir.write(array[i]); |
|
|
|
|
|
|
|
} |
|
|
|
System.out.println(")"); |
|
|
|
Thread.sleep(1000); |
|
|
|
System.out.println("Enhorabuena, su copia ha sido realizada con éxito."); |
|
|
|
Thread.sleep(1000); |
|
|
|
System.out.println("Nos vemos pronto."); |
|
|
|
Thread.sleep(1000); |
|
|
|
System.out.println("¡Un saludo!"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch (IOException e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |