Buffered reader in java is similar to buffered writer. It writes data to files in large chunks. Example of bufffered reader is below.
try(BufferedReader br = new BufferedReader(new FileReader("directions.txt"))) {
String input;
//while next line is not null
while((input = br.readLine())!=null){
//split data on each line into an array based on the comma
String[] data = input.split(",");
int loc = Integer.parseInt(data[0]);
String direction = data[1];
int destination = Integer.parseInt(data[2]);
}
} catch (IOException e) {
e.printStackTrace();
}
}