Advertisement
Guest User

pedaso3

a guest
Nov 29th, 2013
929
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1.     /**
  2.         EDITAR LA DIRECCION DEL ARCHIVO DE TEXTO EL CUAL SERA NUESTRA SALIDA DEL PROGRAMA
  3.     **/    
  4.  
  5.     FileOutputStream salida = new FileOutputStream("C:/Users/GABY/Desktop/GananciasGas.txt");
  6.  
  7.     BufferedOutputStream buf = new BufferedOutputStream(salida);
  8.     leo = entra.read(arreglo,0,arreglo.length);
  9.     contados = leo;
  10.  
  11.     //realiza la lectura de los datos
  12.     do {
  13.        leo =entra.read(arreglo, contados, (arreglo.length-contados));
  14.        if(leo >= 0) contados += leo;
  15.     } while(leo > -1);
  16.  
  17.     buf.write(arreglo, 0 , contados);//lo escribe en el buffer
  18.     buf.flush();//limpia la memoria del buffer
  19.  
  20.     /**
  21.         EDITAR LA DIRECCION DEL ARCHIVO DE TEXTO AL CUAL LE DAREMOS ENTRADA
  22.     **/    
  23.  
  24.     archivo1 = new File ("C:/Users/GABY/Desktop/GananciasGas.txt");
  25.  
  26.     fr1 = new FileReader (archivo1);
  27.     br1 = new BufferedReader(fr1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement