public static void main(String[] args) throws Exception { Files.copy(Paths.get("file/text.txt"), new FileOutputStream("nio.txt")); }
Files类具体使用方法详解