forked from kalmar/DALGLI0
Zaktualizuj 'CRC.java'
This commit is contained in:
parent
477d8a349c
commit
b23027f544
7
CRC.java
7
CRC.java
@ -1,11 +1,12 @@
|
|||||||
public class CRC {
|
public class CRC {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
if (args[1].equals("-e")){
|
if (args.length == 1){
|
||||||
Encoding tmp = new Encoding(args[0]);
|
Encoding tmp = new Encoding(args[0]);
|
||||||
System.out.println(args[0] + tmp.getFcsChars());
|
System.out.println(args[0] + tmp.getFcsChars());
|
||||||
} else if (args[1].equals("-d")){
|
} else if (args.length == 3){
|
||||||
Decoding d = new Decoding(args[0]);
|
String tmp = args[0] + Character.toString((char) Integer.parseInt(args[1])) + Character.toString((char) Integer.parseInt(args[2]));
|
||||||
|
Decoding d = new Decoding(tmp);
|
||||||
System.out.println(d.getCheck());
|
System.out.println(d.getCheck());
|
||||||
}
|
}
|
||||||
} catch (ArrayIndexOutOfBoundsException e){
|
} catch (ArrayIndexOutOfBoundsException e){
|
||||||
|
Loading…
Reference in New Issue
Block a user