java IO to copy one File to another

前端 未结 6 1092
别那么骄傲
别那么骄傲 2020-11-30 09:48

I have two Java.io.File objects file1 and file2. I want to copy the contents from file1 to file2. Is there an standard way to do this without me having to create a method th

6条回答
  •  渐次进展
    2020-11-30 10:30

    If you want to be lazy and get away with writing minimal code use

    FileUtils.copyFile(src, dest)
    

    from Apache IOCommons

提交回复
热议问题