Почему не хочет переводить в char в 39 строке? Уже перепробовал кучу вариантов.
package com.javarush.task.task18.task1821;
/*
Встречаемость символов
*/
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Array;
import java.util.*;
public class Solution {
public static void main(String[] args) throws IOException {
FileInputStream inputStream = new FileInputStream(args[0]);
List<Integer> byteList = new ArrayList<Integer>();
Set<Integer> byteSet = new HashSet<Integer>();
int temp, count =0;
while (inputStream.available()>0){
temp=inputStream.read();
byteList.add(temp);
byteSet.add(temp);
}
inputStream.close();
List<Integer> Sort = new ArrayList<Integer>(byteSet);
Map<Integer, Integer> byteMap = new HashMap<Integer, Integer>();
for (int i=0; i<Sort.size(); i++){
for (int j=0; j<byteList.size(); j++){
if (Sort.get(i) == byteList.get(j)){
count++;
}
}
byteMap.put(Sort.get(i), count);
count=0;
}
char chr;
for (Map.Entry e : byteMap.entrySet()) {
chr = (char) e.getKey();
System.out.println(chr + " " + e.getValue());
}
}
}