package code.kalter.longflight.crypto; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /** * Главный класс * * @author Kalter */ public class Crypto { public static void main(String[] args) throws IOException { final String iname = args[0]; final String oname = args[1]; final int key = Integer.parseInt(args[2], 16); try (InputStream fistream = new CIStream(new FileInputStream(iname), key); OutputStream fostream = new FileOutputStream("_" + oname);) { while (fistream.available() > 0) { fostream.write(fistream.read()); } } catch (FileNotFoundException e) { System.out.println("File not found"); e.printStackTrace(); } catch (IOException e) { System.out.println("I/O error"); } } }