[Yanel-dev] copyFile() method
Alec Bickerton
alec.bickerton at wyona.com
Thu Oct 2 10:12:09 CEST 2008
Michael Wechner wrote:
> Hi
>
> Has anyone an idea why the copyFile() method within
>
> src/java/org/wyona/commons/io/FileUtil.java
>
> is requiring byte[] buffer as an argument and doesn't provide that by
> itself (I mean within the method), which should simplify the usage
> quite a bit, so
>
> copyFile(File src, File dest)
>
> instead
>
> copyFile(File src, File dest, byte[] buffer)
At a guess I would say its to allow the caller to determine the buffer
size. This allows the speed that the copying to be configurable based on
filesize or expected memory constraints.
I haven't really looked at that code so can't say for sure. To be
honest, I would have expected something this generic to appear in a
apache-commons library.
And it does.
http://commons.apache.org/io/api-1.4/org/apache/commons/io/FileUtils.html
Why no just use whats already there?
Alec.
More information about the Yanel-development
mailing list