Не проходит проверку. На своих файлах вроде работает. Помогите найти косяк.
package com.javarush.task.task18.task1823;
import java.io.*;
import java.util.*;
/*
Нити и байты
*/
public class Solution {
public static Map<String, Integer> resultMap = new HashMap<String, Integer>();
public static void main(String[] args) throws IOException {
try(BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in))){
ReadThread rf;
String name;
while(true){
name=bufferedReader.readLine();
if(name.equals("exit")) break;
rf = new ReadThread(name);
rf.start();
}
}
}
public static class ReadThread extends Thread {
private String fileName;
public ReadThread(String fileName) {
this.fileName=fileName;
//implement constructor body
}
@Override
public void run() {
try(BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(fileName))) {
int[] arrByte = new int[bufferedInputStream.available()];
ArrayList<Integer> countList = new ArrayList<>();
int i=0;
while(bufferedInputStream.available()>0){
arrByte[i]=bufferedInputStream.read();
i++;
}
int count=0;
for(i=0; i<arrByte.length;i++){
for(int j=0; j<arrByte.length;j++){
if(arrByte[i]==arrByte[j]) count++;
}
countList.add(count);
count=0;
}
synchronized (Solution.resultMap){
Solution.resultMap.put(fileName, Collections.max(countList));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
// implement file reading here - реализуйте чтение из файла тут
}
}