copy the content of a file to another file.
来源:互联网 发布:依云订水软件 编辑:程序博客网 时间:2024/04/30 13:18
public void copy(File src, File dst) throws IOException {
//if the parameters are same,then don't excute anything.or it make original file null.
if(!src.getAbsolutePath().equalsIgnoreCase(dst.getAbsolutePath())){
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
}
- copy the content of a file to another file.
- Appending to the End of a File
- Change the content of the file
- 如何窥探PDB的秘密?(How to Inspect the Content of a Program Database (PDB) File)
- Linux,clear the content of linux file
- A script to change the background of pdf file!
- The Process of Write a File to Encryption Zone
- unable to find a 'userdata.img' file for ABI armeabi to copy into the AVD folder
- Unable to find a 'userdata.img' file for ABI armeabi to copy into the AVD fold
- Unable to find a 'userdata.img' file for ABI armeabi to copy into the AVD folder
- Unable to find a 'userdata.img' file for ABI armeabi to copy into the AVD folder.
- RMAN-06024: no backup or copy of the control file found to restore
- copy a single file
- Copy a file
- Copy a file
- How to invoke a function from another .cpp source file
- Some code about copying from a file to another
- command to get the man page content to file
- 文学常识连载三
- 转载--SQL Server 索引结构及其使用
- 疯狂填字600期游戏打包版发布
- java文件操作大全(转贴)
- [转载]关于struts的学习!
- copy the content of a file to another file.
- [转贴]弹出窗口详解
- 今天才申请的blog.我的网址是:http://www.wbzh.tk,http://blog.csdn.net/WBZH/
- Smarty的分页实现
- 正则表达式
- 表格动态调整(转)
- 什么叫做火星帖
- Winform下datagrid数据倒入excel
- 动态组合公式的运算