Java Snippet – Fast File Copy
When using JDK 1.4 and above...
JAVA:
-
try {
-
sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel);
-
// or, you can also copy it this way
-
// destinationChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
-
sourceChannel.close();
-
destinationChannel.close();
-
e.printStackTrace();
-
}
-
}
No Comments so far
Leave a comment
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>