⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 copyfile.java

📁 包括了许多源码,多线程,不用第三方变量交换变量值等源码
💻 JAVA
字号:

import java.io.*;

public class copyfile {
	/**
	 * @param args
	 */
	String file1,file2;

	public copyfile(String file1,String file2){
		this.file1=file1;
		this.file2=file2;

	}
	
	public void copyf(){
		try{
			InputStream input=new FileInputStream(file1);
			OutputStream output=new FileOutputStream(file2);
			byte[] b=new byte[1024];
			while(input.read(b)!= -1){
				output.write(b);
			}
			
		}
			
		catch(Exception e){
			System.out.println(e.getMessage());
		}		
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		copyfile cf1=new copyfile("c:\\1.pdf","d:\\1.pdf");
		new th(cf1).start();
		copyfile cf2=new copyfile("c:\\1.pdf","d:\\2.pdf");
		new th(cf2).start();
		copyfile cf3=new copyfile("c:\\1.pdf","d:\\3.pdf");
		new th(cf3).start();
		
	}

	
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -