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

📄 filetransport.java

📁 用java写的浏览器的服务器和客户端程序
💻 JAVA
字号:
/**
 * Email: taorundong@126.com
 *
 * @author taorundong
 * @version 1.00 07/02/11
 */
 
 import java.util.*;
 import java.net.*;
 import java.io.*;
 
public class FileTransport extends Thread implements Runnable{
	
	File file = null;
	FileInputStream fileInput = null;
	
	
	FileTransport(){
		super();
		
		try{
			file = new File("hello.wav");
			fileInput = new FileInputStream(file);
			
		}
		catch(Exception e){
			e.printStackTrace();
		}
		
		transMission("press.wav");
	}
	
	
	public void transMission(String name){
		
		File temp = new File(name);
		
		try{
			FileOutputStream output = new FileOutputStream(temp);
			byte []b = new byte[100];
			
			while(fileInput.read(b)!=-1){
			output.write(b);
			}
			fileInput.close();
			output.close();
		}
		catch(Exception e){
			e.printStackTrace();
		}
	}
	
	
}

⌨️ 快捷键说明

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