в чем проблема\ы?
package com.javarush.task.task18.task1823;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
/*
Нити и байты
*/
public class Solution {
public static Map<String, Integer> resultMap = new HashMap<String, Integer>();
public static ArrayList<String> filenames = new ArrayList<>();
public static void main(String[] args) throws Exception{
Scanner scanner = new Scanner(System.in);
while (scanner.nextLine().equals("exit")) {
filenames.add(scanner.nextLine());
}
scanner.close();
for (String i: filenames) {
ReadThread thread = new ReadThread(i);
thread.run();
}
}
public static class ReadThread extends Thread {
public ReadThread(String fileName) throws Exception {
FileInputStream fileInputStream = new FileInputStream(fileName);
byte[] buffer = new byte[fileInputStream.available()];
fileInputStream.read(buffer);
byte mostPopularByte = buffer[0];
int count =0;
for (byte i : buffer) {
int tempCount = 0;
for (byte j: buffer) {
if (buffer[i]==buffer[j]) count++;
}
if (tempCount>count){
count = tempCount;
mostPopularByte = buffer[i];
}
}
fileInputStream.close();
resultMap.put(fileName, (int) mostPopularByte);
}
// implement file reading here - реализуйте чтение из файла тут
}
}