-
Is there a better/faster/more efficient way to copy files? (5 messages)
- Posted by: Teddy Wang
- Posted on: September 24 2007 15:18 EDT
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!Threaded Messages (5)
- The Closer you Are to the File System, the Faster You Can be by Chris Coy on September 25 2007 17:11 EDT
- Re: The Closer you Are to the File System, the Faster You Can be by Mayur Purandar on September 26 2007 00:46 EDT
- Java.nio by Reinaldo Braga on October 15 2007 15:40 EDT
- Re: Is there a better/faster/more efficient way to copy files? by Angel Stewart on December 07 2007 15:12 EST
- Re: Is there a better/faster/more efficient way to copy files? by Johannes Zillmann on May 06 2008 05:51 EDT
-
The Closer you Are to the File System, the Faster You Can be[ Go to top ]
- Posted by: Chris Coy
- Posted on: September 25 2007 17:11 EDT
- in response to Teddy Wang
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. -
Re: The Closer you Are to the File System, the Faster You Can be[ Go to top ]
- Posted by: Mayur Purandar
- Posted on: September 26 2007 00:46 EDT
- in response to Chris Coy
In theory, the fastest way to copy files (given the possibility of network shares,) is to zip them, copy the zip, then unzip.
May be a file rename would help....
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. -
Java.nio[ Go to top ]
- Posted by: Reinaldo Braga
- Posted on: October 15 2007 15:40 EDT
- in response to Chris Coy
Have you ever tried java.nio ? It´s pretty fast ! -
Re: Is there a better/faster/more efficient way to copy files?[ Go to top ]
- Posted by: Angel Stewart
- Posted on: December 07 2007 15:12 EST
- in response to Teddy Wang
java.nio is pretty quick for those types of tasks. Leather Sofas -
Re: Is there a better/faster/more efficient way to copy files?[ Go to top ]
- Posted by: Johannes Zillmann
- Posted on: May 06 2008 05:51 EDT
- in response to Angel Stewart
posted how to do that with nio http://o-a-e.blogspot.com/2008/05/fastest-way-to-copy-files.html