Discussions

Performance and scalability: Is there a better/faster/more efficient way to copy files?

  1. I've got code that I've been using since JDK 1.1. It's basically the same code that you will readily find if you search for "java file copy" on Google which uses File and FileInputStream/FileOutputStream. This can't possibly be the best/fastest/more efficient way to copy files. Does anybody have another way to do this? I've got an app that needs to copy thousands of files (of varying sizes) as quickly as possible. Thanks!
  2. In theory, the fastest way to copy files (given the possibility of network shares,) is to zip them, copy the zip, then unzip. Depends on what problem you're trying to solve - the fastest way to copy files is to ask the operating system to do it. In other words generate a command line or shell script and execute it.
  3. In theory, the fastest way to copy files (given the possibility of network shares,) is to zip them, copy the zip, then unzip.

    Depends on what problem you're trying to solve - the fastest way to copy files is to ask the operating system to do it. In other words generate a command line or shell script and execute it.
    May be a file rename would help....
  4. Java.nio[ Go to top ]

    Have you ever tried java.nio ? It´s pretty fast !
  5. java.nio is pretty quick for those types of tasks. Leather Sofas
  6. posted how to do that with nio http://o-a-e.blogspot.com/2008/05/fastest-way-to-copy-files.html