use BufferedReader instead of randomaccessfile