1 package code
.kalter
.longflight
.crypto
;
3 import java
.io
.FileInputStream
;
4 import java
.io
.FileNotFoundException
;
5 import java
.io
.FileOutputStream
;
6 import java
.io
.IOException
;
7 import java
.io
.InputStream
;
8 import java
.io
.OutputStream
;
17 public static void main(String
[] args
) throws IOException
{
18 final String iname
= args
[0];
19 final String oname
= args
[1];
20 final int key
= Integer
.parseInt(args
[2], 16);
21 try (InputStream fistream
= new CIStream(new FileInputStream(iname
), key
);
22 OutputStream fostream
= new FileOutputStream("_" + oname
);) {
23 while (fistream
.available() > 0) {
24 fostream
.write(fistream
.read());
26 } catch (FileNotFoundException e
) {
27 System
.out
.println("File not found");
29 } catch (IOException e
) {
30 System
.out
.println("I/O error");