Вылетает на знаке минус в намбер эксепшн
package com.javarush.task.task13.task1326;
/*
Сортировка четных чисел из файла
*/
import java.io.*;
public class Solution {
public static void main(String[] args) {
try {
// C:\\Users\\User\\Desktop\\ab.txt
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
InputStream file = new FileInputStream(reader.readLine());
while (file.available()>0){
String s = String.valueOf((char) file.read());
String[] c = s.split("\\n");
int[] num = new int[c.length];
for (int i = 0; i < c.length; i++){
num[i] = Integer.parseInt((c[i]))-'0';
}
for(int i=0;i<num.length;i++){
System.out.println(num[i]);
}
}
System.out.println();
file.close();
} catch (IOException e) {
System.out.println(e);
}
reader.close();
}
catch (IOException e){
System.out.println(e);
}// напишите тут ваш код
}
}
