diff --git a/bin/jorpelu/com/MyCopy.class b/bin/jorpelu/com/MyCopy.class index 1a3ebbd..85b8714 100644 Binary files a/bin/jorpelu/com/MyCopy.class and b/bin/jorpelu/com/MyCopy.class differ diff --git a/src/jorpelu/com/MyCopy.java b/src/jorpelu/com/MyCopy.java index 34d489b..cd95e76 100644 --- a/src/jorpelu/com/MyCopy.java +++ b/src/jorpelu/com/MyCopy.java @@ -1,76 +1,64 @@ package jorpelu.com; import java.io.*; +import java.io.File; import java.util.ArrayList; +import java.util.Scanner; -import javax.swing.JFrame; -import javax.swing.JPanel; - -public class MyCopy { +public class MyCopy { + Ventana ventana; - public MyCopy(String RutaIn, JFrame jf, String RutaOut){ - - if(RutaOut==null) { - RutaOut = "."; - } - File fich = new File(RutaOut); - File fich_a_copiar = new File(RutaIn); - - + public static void main(String[] args) throws FileNotFoundException, IOException { + File fich = new File(".\\Salida.dat"); + File fich_a_copiar = new File("textp.dat"); if(fich_a_copiar.exists() == false) { - try { - fich_a_copiar.createNewFile(); - } catch (IOException e) { - - e.printStackTrace(); - } + fich_a_copiar.createNewFile(); } String[] calculando = {"-", "\\", "|", "/"}; - FileInputStream in; - try { - in = new FileInputStream(fich_a_copiar); - + FileInputStream in = new FileInputStream(fich_a_copiar); DataInputStream din = new DataInputStream(in); FileOutputStream out = new FileOutputStream(fich); DataOutputStream dout = new DataOutputStream(out); - int cal=0; int i=0; int c; ArrayList bufferin = new ArrayList(); - while((c =din.read()) != -1 && bufferin.add(c)) { + while((c = din.read() ) != -1 && bufferin.add(c)) { System.out.println(calculando[cal]); cal++; if (cal >= 4) cal = 0; + + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } for(int j = 0; j