Ребята, подтолкните ))) Уже не вижу где может быть трабл.
package com.javarush.task.task18.task1823;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
/*
Нити и байты
*/
public class Solution {
public static Map<String, Integer> resultMap = new HashMap<String, Integer>();
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String name;
while (!(name = reader.readLine()).equals("exit")){
new ReadThread(name).start();
}
reader.close();
}
public static class ReadThread extends Thread {
String file;
FileInputStream in = null;
int max ;
int [] bytes = new int[256];
public ReadThread(String fileName) {
super(fileName);
file = fileName;
}
@Override
public void run() {
try { in = new FileInputStream(file);
while (in.available()>0){
bytes[in.read()]++;
}
for (int i = 0; i <bytes.length; i++) {
if(bytes[i]> max){
max = i;
}
}
resultMap.put(file, max);
in.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}