当前位置:网站首页>Realization of file copy
Realization of file copy
2020-11-08 21:03:00 【8Years】
public class TestIO01 {
public static void main(String[] args) {
copy("D:/aaa.txt","D:/B.txt");// Copy the contents of the former file into the latter qu
}
public static void copy(String srcfile,String destpath) {
File file=new File(srcfile);
File file1=new File(destpath);
InputStream is=null;
OutputStream os=null;
try {
is=new FileInputStream(file);
os=new FileOutputStream(file1);
byte[] car=new byte[3];
int temp;
int len;
while((len=is.read(car))!=-1){
os.write(car,0, len);
String str=new String(car,0,len);
}
os.flush();
} catch (FileNotFoundException fileNotFoundException) {
fileNotFoundException.printStackTrace();
} catch (IOException ioException) {
ioException.printStackTrace();
}finally{
try{
if(is!=null){
is.close();
}
}catch (IOException ioException){
ioException.printStackTrace();
}
try{
if(is!=null){
is.close();
}
}catch (IOException ioException){
ioException.printStackTrace();
}
}
}
}
版权声明
本文为[8Years]所创,转载请带上原文链接,感谢
边栏推荐
- 国内三大云数据库测试对比
- Summary of interface test case ideas
- Experiment 1 assignment
- Dynamic relu: Microsoft's refreshing device may be the best relu improvement | ECCV 2020
- APReLU:跨界应用,用于机器故障检测的自适应ReLU | IEEE TIE 2020
- Solve the failure of go get download package
- Queue with two stacks
- 第五章
- Dynamic ReLU:微软推出提点神器,可能是最好的ReLU改进 | ECCV 2020
- Dynamic relu: Microsoft's refreshing device may be the best relu improvement | ECCV 2020
猜你喜欢

学会了volatile,你变心了,我看到了

abp(net core)+easyui+efcore实现仓储管理系统——出库管理之五(五十四)

The interface testing tool eolinker makes post request

To introduce to you, this is my flow chart software—— draw.io

实现图片的复制

Aprelu: cross border application, adaptive relu | IEEE tie 2020 for machine fault detection

Part I - Chapter 1 Overview

给大家介绍下,这是我的流程图软件 —— draw.io

如何将 PyTorch Lightning 模型部署到生产中

动态规划设计:最大子数组
随机推荐
如何让脚本同时兼容Python2和Python3?
The interface testing tool eolinker makes post request
进程 线程 协程
寻找性能更优秀的动态 Getter 和 Setter 方案
200 programmers interview experience, all here
Dynamic query processing method of stored procedure
C / C + + knowledge sharing: function pointer and pointer function, can you understand after reading this article?
Newbe.ObjectVisitor 样例 1
If the programming language as martial arts unique! C++ is Jiu Yin Jing. What about programmers?
JVM真香系列:轻松理解class文件到虚拟机(下)
信息安全课程设计第一周任务(7条指令的分析)
200人的程序员面试经验,都在这里了
Classical dynamic programming: longest common subsequence
Not a programmer, code can't be too ugly! The official writing standard of Python: pep8 everyone should know
Countdownlatch explodes instantly! Based on AQS, why can cyclicbarrier be so popular?
Express framework
APReLU:跨界应用,用于机器故障检测的自适应ReLU | IEEE TIE 2020
构造回文的最小插入次数
Learn volatile, you change your mind, I see
国内三大云数据库测试对比