当前位置: 技术问答>java相关
请问这段程序中start1()是做什么用的???
来源: 互联网 发布时间:2015-06-12
本文导语: package transfers; import java.io.*; import java.net.*; import javax.swing.*; import com.borland.jbcl.layout.*; import java.awt.*; /** * Title: * Description: * Copyright: Copyright (c) 2002 * Company: * @author unascribed * @version 1.0 */ //publ...
package transfers;
import java.io.*;
import java.net.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import java.awt.*;
/**
*
*
*
*
* @author unascribed
* @version 1.0
*/
//public class socket_thread extends Thread{
public class socket_thread {
private Socket s;
private BufferedReader in;
private BufferedOutputStream out;
// private FileInputStream in;
private FileInputStream filein;
private File f;
private error err;
public socket_thread(String ip,int port,File outfile) {
try{
f=outfile;
s=new Socket(ip,port);
in=new BufferedReader(new InputStreamReader(s.getInputStream()));
filein=new FileInputStream(f);
out=new BufferedOutputStream(s.getOutputStream());
}catch(Exception ex){
ex.printStackTrace();
System.out.print("connection error");
err=new error(ex.getMessage());
err.show();
}
}
public void start1(){
int i;
int r=0;
byte[] b=new byte[(int)f.length()];
for(i=1;i
import java.io.*;
import java.net.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import java.awt.*;
/**
*
Title:
*
Description:
*
Copyright: Copyright (c) 2002
*
Company:
* @author unascribed
* @version 1.0
*/
//public class socket_thread extends Thread{
public class socket_thread {
private Socket s;
private BufferedReader in;
private BufferedOutputStream out;
// private FileInputStream in;
private FileInputStream filein;
private File f;
private error err;
public socket_thread(String ip,int port,File outfile) {
try{
f=outfile;
s=new Socket(ip,port);
in=new BufferedReader(new InputStreamReader(s.getInputStream()));
filein=new FileInputStream(f);
out=new BufferedOutputStream(s.getOutputStream());
}catch(Exception ex){
ex.printStackTrace();
System.out.print("connection error");
err=new error(ex.getMessage());
err.show();
}
}
public void start1(){
int i;
int r=0;
byte[] b=new byte[(int)f.length()];
for(i=1;i