I am using BufferReader to read log files from a game server. It does work but it just doesn't read the entire file just a small portion of it.
My code:

public ArrayList readFile(File file){ try (BufferedReader br = new BufferedReader(new FileReader(file.getAbsolutePath()))) { String sCurrentLine; ArrayList list = new ArrayList(); while ((sCurrentLine = br.readLine()) != null) { list.add(sCurrentLine); } return list; } catch (IOException e) { e.printStackTrace(); } return null; }The files that i try to read have the size between 0.5 MB - 1.5 MB. The server logs look like this but it has many more lines. Like 20000 lines. I am only getting like 1500 lines from it.

00:05:29 - Great_Zhupan_Uros_SRB Wolfpack_SikiciArthasan 00:05:32 - Teamhit: AE_Shemaforash hit AB_Artorius for 10 hp. 00:05:32 - AE_Shemaforash AB_Artorius 00:05:32 - AE_Shemaforash(20578) teamkilled AB_Artorius(1076080). 00:05:41 - Great_Zhupan_Uros_SRB IR_Fall3N~3nG3l 00:05:46 - AE_Shemaforash Xodanrot00:06:05 - *DEAD* [AE_Blivandefar] dio porco shema 00:06:05 - Wolfpack_Dennell has joined the game with ID: 1305305 00:06:07 - Wolfpack_Dennell joined the server. The log file starts at time 00:00:00 and ends at 23:59:59. When i start reading it, it only reads a small part of it like from 22:08:00 to 23:59:59. Can someone tell me what i am doing wrong? And if there are better solutions for this then i am all ears. Im using this data to convert them into statistics for players.
An example what i do with the strings.

public void readPlayers(ArrayList list){ ArrayList joinedPlayers = new ArrayList(); for (String string : list) { if (string.contains("has joined the game with ID: ")) { joinedPlayers.add(string); } } Player p; for (String string : joinedPlayers){ String strList[] = string.split(" "); p = new Player(); p.playerId = strList[10]; p.playerName = strList[3]; if(PlayerContainer.getInstance().checkIfPlayerExis ts(p) == false){ PlayerContainer.getInstance().getPlayersList().add (p); } } setChanged(); notifyObservers();}

Check Solution