Подскажите пожалуйста
package com.javarush.task.task18.task1823;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Collections;
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();
}
}
public static class ReadThread extends Thread {
private static String file;
public ReadThread(String fileName) {
this.file = fileName;
//implement constructor body
}
@Override
public void run() {
Map<Integer, Integer> bytes = new HashMap<>();
try (FileInputStream stream = new FileInputStream(file)) {
int number = 0;
while ((number = stream.read()) != -1) {
if (!bytes.containsKey(number)) {
bytes.put(number, 1);
} else bytes.put(number, bytes.get(number) + 1);
}
int maxValue = Collections.max(bytes.values());
int max = 0;
for (Map.Entry entry : bytes.entrySet()) {
if (entry.getValue().equals(maxValue)) {
max = (int) entry.getKey();
}
}
resultMap.put(file, max);
} catch (IOException e) {
e.printStackTrace();
}// implement file reading here - реализуйте чтение из файла тут
}
}
}