import java.io.FileInputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
public class Server {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
ServerSocket server = new ServerSocket(9999);
Socket sock = server.accept();
FileInputStream in = new FileInputStream("c:\\a\\1.html");
OutputStream out = sock.getOutputStream();
int len = 0;
byte buffer[] = new byte[1024];
while((len = in.read(buffer)) > 0){
out.write(buffer, 0, len);
}
in.close();
out.close();
sock.close();
server.close();
}
}