Ну я же тоже шифру)))просто ))но шифрую))
package com.javarush.task.task18.task1826;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
/*
Шифровка
*/
public class Solution {
public static void main(String[] args) throws IOException {
// args = new String[]{"-d", "file.txt", "file1.txt"};
FileInputStream stream = new FileInputStream(args[1]);
FileOutputStream stream1 = new FileOutputStream(args[2]);
switch (args[0]) {
case ("-c"):
while (true) {
if (stream.available() > 0) {
int x = stream.read() + 1;
stream1.write(x);
} else break;
}
break;
case ("-d"):
while (true) {
if (stream.available() > 0) {
int x = stream.read() - 1;
stream1.write(x);
} else break;
}
break;
}
stream.close();
stream1.close();
}
}