Doesn't work, and i dont understand why. Help me please
package com.codegym.task.task18.task1821;
/*
Symbol frequency
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception{
InputStream inputStream = new FileInputStream(args[0]);
List<Integer> datos = new ArrayList<>();
while (inputStream.available() > 0){
datos.add(inputStream.read());
}
inputStream.close();
Collections.sort(datos);
Map<Character, Integer> mapa = new HashMap<>();
for (int i = 0; i < datos.size(); i++){
int n = datos.get(i);
char c = (char) n;
if (mapa.containsKey(c)){
int numero = mapa.get(c);
mapa.replace(c, numero+1);
}else{
mapa.put(c, 0);
}
}
for (Map.Entry<Character, Integer> entry : mapa.entrySet()){
System.out.println(entry.getKey() + " = " + entry.getValue());
}
}
}