Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.Scanner;
- public class Cifrado {
- public static void main(String[] args) {
- String nombreFicheroEntrada = (args[0]);
- String nombreFicheroSalida = (args[0]).concat(".cfr");
- int clave = Integer.parseInt(args[1]);
- //
- String linea = "";
- File f;
- f = new File(nombreFicheroEntrada);
- Scanner scFile = null;
- try {
- scFile = new Scanner(f, "UTF-8");
- while (scFile.hasNextLine()) {
- linea = scFile.nextLine();
- Utils.escribelo(nombreFicheroSalida, linea, clave); //METODO ESCRIBELO
- }
- // System.out.println("Linea: \n" + linea);
- } catch (Exception e) {
- System.out.println("Se ha producido un error");
- } finally {
- if (scFile != null) {
- scFile.close();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement