Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaÀûÓÃSocketÍøÂç´«µÝÎļþ

·þÎñÆ÷¶Ë:
package com.huahua;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class ServerThread extends Thread {
private Socket socket;
public ServerThread(Socket socket) {
super();
this.socket = socket;
}
public void run(){

try {
while(true){
DataInputStream in = new DataInputStream(socket.getInputStream());

//½ÓÊÕ±£´æµÄ·¾¶
String path = "e:\\" + in.readUTF();
//½ÓÊÕµÄÎļþ³¤¶È
long length = in.readLong();

//±£´æÎļþ
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(
new FileOutputStream(path)));
byte[] buf = new byte[1024];
int len = 0;
while((len=in.read(buf))!=-1){
out.write(buf,0,buf.length);
}
out.flush();
out.close();
in.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}

public static void main(String[] args){
try {
ServerSocket serverSocket = new ServerSocket(9999);
while(true){
new ServerThread(serverSocket.accept()).start();
}

} catch (IOException e) {
e.printStackTrace();
}
}
}

¿Í»§¶Ë:
package com.huahua;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.Socket;
public class Client{
public static void main(String[] args){

FileInputStream fin = null;
DataOutputStream out = null;
try {
Socket socket = new Socket("127.0.0.1",9999);
File file = new File("f:\\ÕÅ»ÝÃà - ²Êºç.wma");
out = new DataOutputStream(socket.getOutputStream());

//´«ËÍÎļþÃû³Æ
out.writeUTF(file.getName());
out.flush();

//´«ËÍÎļþ³¤¶È
out.writeLong(file.length());
out.flush();

//´«ËÍÎļþ
fin = new FileIn


Ïà¹ØÎĵµ£º

×îÖØÒªµÄ Java EE ×î¼Ñʵ¼ù


Ô­ÎÄÇë¿´
http://www.ibm.com/developerworks/cn/websphere/techjournal/0701_botzum/0701_botzum.html
ºóÐøÎÒ»á¶ÔÏÂÃæÌáµ½µÄ19µã½øÐÐһЩÊʵ±µÄÅú×¢,ËãÊÇ×Ô¼ºµÄ¶ÁÊé±Ê¼Ç
ÒýÑÔ
ÔÚ¹ýÈ¥µÄ¼¸ºõÕûÕûÊ®ÄêÖУ¬ÈËÃDZàдÁ˺ܶàÓÐ¹Ø Java™ Platform, Enterprise Edition (Java EE) ×î¼Ñʵ¼ùµÄÄÚÈÝ¡£ÏÖÔÚÓÐÊ®¶à±¾Êé¼®ºÍÊý ......

java ftpÉÏ´«ºÍÏÂÔØ

Ê×ÏÈ£¬½¨3¸ö½Ó¿Ú
FTPOperate.java:
public interface FTPOperate
{
public void execute(FTPBean entity);
}

FTPProxy.java:
public interface FTPProxy
{
public void connection();
public abstract void upload();

public abstract void download();
public void setEntity(FTPBe ......

×îÖØÒªµÄ Java EE ×î¼Ñʵ¼ù 1. ʼÖÕʹÓà MVC ¿ò¼Ü


 
1. ʼÖÕʹÓà MVC ¿ò¼Ü¡£
½«ÒµÎñÂß¼­£¨Java Bean ºÍ EJB ×é¼þ£©´Ó¿ØÖÆÆ÷Âß¼­£¨Servlet/Struts ²Ù×÷£©ºÍ±íʾÂß¼­£¨JSP¡¢XML/XSLT£©ÖÐÇåÎúµØ·ÖÀë³öÀ´¡£Á¼ºÃµÄ·Ö²ã¿ÉÒÔ´øÀ´Ðí¶àºÃ´¦¡£
×¢:¶ÔÓÚһЩСÐ͵ĻòÕßÒµÎñÏà¶Ô¼òµ¥µÄϵͳ¶øÑÔ,Óÿò¼Ü¿ª·¢²¢²»ÄÜ´øÀ´ÈκÎЧÒæ,²¢ÇÒÎÒÉîÐÅÔÚһЩÏîÄ¿¿ª·¢ÖÐ,ÌرðÊǽö½öÓÉij¸öÈ˶ÀÁ ......

java½ðÈÚÓëÊýѧ

 
1¡¢commons-math/commons-lang-math
ÒÔÉÏÁ½¸ö°üÊÇapacheϵģ¬Ç°Õ߱ȺóÕߵŦÄÜÇ¿´ó£¬ºóÕßÓеŦÄÜÇ°¶¼ÓУ¬ºóÕßÖ÷Òª½â¾öƽʱ³ÌÐòÖеÄһЩ»ù±¾µÄÊýѧ¼ÆË㣬Ö÷ÒªÊÇ·¶Î§Åжϣ¨*Range£©,Ëæ»úÊýÉú³É£¨JVMRandom,RandomUtils£©£¬·ÖÊý´¦Àí£¨Fraction£©£¬Êý×Öת»¯¡¢´óСÅжϣ¨NumberUtils£©µÈ¡£Ç°Õß¿ÉÒÔ´¦Àí¸ü¸´ÔÓµÄÊý¾Ý·Ö ......

Java×ÀÃ濪·¢±Ê¼Ç

      ÐèÒª×öÒ»¸ö×ÀÃæµÄС¶«Î÷£¬ÓÉÓÚÖÁ½ñΪֹֻ»áдJava£¬ËùÒÔÖ»ÓÐÓÃswingÀ´×öÁË¡£ÅóÓÑ˵Delphi×öÆðÀ´ºÜ¿ì£¬µ«ÎÒûʱ¼äȥѧÁË£¬Ò»¶¨Òª¿ªÊ¼ºáÏò·¢Õ¹ÁË¡£
     Ô­À´¶ÌÔݵÄ×ö¹ýNetBeansµÄrcp¿ª·¢£¬µ«ËüµÄ´úÂë×éÖ¯Óеã¹ýÓÚ¸´ÔÓ£¬²»¹ýÎÒÒª×öµÄ²»ÊǺܴóµÄ¶«Î÷£¬µ«»¹ÊÇÏëÏÈÕÒEclips ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ