I am not sure I understand your question. Which part of the above code are you asking about - the try-with-resource part, the fr.read call, fw.write call, or something else?
i tought this way was only made for BufferedReader, but actually FileReader can also use this way, BufferedReader has only readLine that FileReader has not