BufferedReader then write to txt file?
问题 Is it possible to use BufferedReader to read from a text file, and then while buffered reader is reading, at the same time it also storing the lines it read to another txt file using PrintWriter? 回答1: If you use Java 7 and want to copy one file directly into another, it is as simple as: final Path src = Paths.get(...); final Path dst = Paths.get(...); Files.copy(src, dst); If you want to read line by line and write again, grab src and dst the same way as above, then do: final BufferedReader