// Getting file channels
FileChannel in = new FileInputStream(source).getChannel();
FileChannel out = new FileOutputStream(target).getChannel();
// JavaVM does its best to do this as native I/O operations.
in.transferTo (0, in.size(), out);
// Closing file channels will close corresponding stream objects as well.
out.close();
in.close();
Комментариев нет:
Отправить комментарий