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

JavaʵÏÖÎļþ¿½±´µÄ4ÖÖ·½·¨

ʹÓà java ½øÐÐÎļþ¿½±´ ÏàÐźܶàÈ˶¼»áÓÃ,,²»¹ýЧÂÊÉÏÊÇ·ñ×îºÃÄØ?
×î½ü¿´ÁË¿´NIO¾ö¶¨ÊÔÒ»ÊÔ java  NIO µ½µ×ÓÐʲôÐÔÄܵÄÌáÉý.
µÚÒ»ÖÖ·½·¨:¹ÅÀϵķ½Ê½
 public static long forJava(File f1,File f2) throws Exception{
  long time=new Date().getTime();
  int length=2097152;
  FileInputStream in=new FileInputStream(f1);
  FileOutputStream out=new FileOutputStream(f2);
  byte[] buffer=new byte[length];
  while(true){
   int ins=in.read(buffer);
   if(ins==-1){
    in.close();
    out.flush();
    out.close();
    return new Date().getTime()-time;
   }else
    out.write(buffer,0,ins);
  }
 }
·½·¨µÄ2²ÎÊý·Ö±ðÊÇԭʼÎļþ,ºÍ¿½±´µÄÄ¿µÄÎļþ.ÕâÀï²»×ö¹ý¶à½éÉÜ.
ʵÏÖ·½·¨ºÜ¼òµ¥,·Ö±ð¶Ô2¸öÎļþ¹¹½¨ÊäÈëÊä³öÁ÷,²¢ÇÒʹÓÃÒ»¸ö×Ö½ÚÊý×é×÷ΪÎÒÃÇÄÚ´æµÄ»º´æÆ÷, È»ºóʹÓÃÁ÷´Óf1 ÖжÁ³öÊý¾Ýµ½»º´æÀï,ÔÚ½«»º´æÊý¾Ýдµ½f2ÀïÃæÈ¥.ÕâÀïµÄ»º´æÊÇ2MBµÄ×Ö½ÚÊý×é
µÚ2ÖÖ·½·¨:ʹÓÃNIOÖеĹܵÀµ½¹ÜµÀ´«Êä
    public static long forTransfer(File f1,File f2) throws Exception{
        long time=new Date().getTime();
        int length=2097152;
        FileInputStream in=new FileInputStream(f1);
        FileOutputStream out=new FileOutputStream(f2);
        FileChannel inC=in.getChannel();
        FileChannel outC=out.getChannel();
        int i=0;
        while(true){
            if(inC.position()==inC.size()){
                inC.close();
                outC.cl


Ïà¹ØÎĵµ£º

½âÎöJavaÀàºÍ¶ÔÏóµÄ³õʼ»¯¹ý³Ì

ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖƵÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬ ......

Javaʵѵ

 ÎÒÃÇÿ¸öѧÆÚÄ©¶¼»á½øÐн«½üÒ»¸öÔµÄʵѵ£¬Õâ´ÎJavaʵѵҲ¼´½«½áÊø£¬ÎÒÑ¡µÄ¿ÎÌâÊÇ“¸öÈËÍøÉÏÒøÐÐϵͳ”£¬ÔËÓÃÁËStruts£¬HibernateºÍSpring¿ò¼Ü£¬Í¨¹ýmvcÉè¼Æģʽ¡£»ù±¾ËùÓеŦÄܶ¼ÊµÏÖÁË£¬ÔÚʵѵÖÐÕæµÄѧµ½Á˺ܶà֪ʶ£¬Ö®¼äÒ²Óöµ½Á˺ܶàÎÊÌ⣬µ«¶¼Ò»Ò»µÃµ½½â¾ö¡£ÎÒ½øÒ»²½Á˽âÁËStrutsµÄÔËÐÐÔ­Àí£¬ÂíÉÏÃæÁÙ ......

Java Serializable£¨ÐòÁл¯£©µÄÀí½âºÍ×ܽá

1¡¢ÐòÁл¯ÊǸÉʲôµÄ£¿
       ¼òµ¥Ëµ¾ÍÊÇΪÁ˱£´æÔÚÄÚ´æÖеĸ÷ÖÖ¶ÔÏóµÄ״̬£¨Ò²¾ÍÊÇʵÀý±äÁ¿£¬²»ÊÇ·½·¨£©£¬²¢ÇÒ¿ÉÒ԰ѱ£´æµÄ¶ÔÏó״̬ÔÙ¶Á³öÀ´¡£ËäÈ»Äã¿ÉÒÔÓÃÄã×Ô¼ºµÄ¸÷ÖÖ¸÷ÑùµÄ·½·¨À´±£´æobject states£¬µ«ÊÇJava¸øÄãÌṩһÖÖÓ¦¸Ã±ÈÄã×Ô¼ººÃµÄ±£´æ¶ÔÏó״̬µÄ»úÖÆ£¬ÄǾÍÊÇÐòÁл¯¡£
2¡¢Ê²Ã´Çé¿öÏ ......

Myeclipse±¨Could not create Java VM

Myeclipse±¨Could not create Java VM
 
»·¾³£º
Myeclipse6.0£¬tomcat6.0, 2GÄÚ´æ
½ñÌìһֱʹÓÃDEBUGģʽÆô¶¯tomcatÒ»Ö±ºÜÂý£¬ËùÒÔÏëʹÓÃRUNģʽÀ´Æô¶¯£¬µ«ÊÇÿ´ÎÆô¶¯¶¼±¨´í“could not create the java virtual machine”£¬ÌáʾÉèÖÃÄÚ´æ²»×㣬°Ù¶ÈÏ£¬¶¼ÒªÇóÐÞ¸Äeclipse.iniÅäÖÃÎļþ£¬µ«ÊÇÐÞ¸ÄÁ˲»ºÃÊ ......

Lucene£º»ùÓÚJavaµÄÈ«ÎļìË÷ÒýÇæ¼ò½é


LuceneÊÇÒ»¸ö»ùÓÚJavaµÄÈ«ÎÄË÷Òý¹¤¾ß°ü¡£
»ùÓÚJavaµÄÈ«ÎÄË÷ÒýÒýÇæLucene¼ò½é£º¹ØÓÚ×÷ÕߺÍLuceneµÄÀúÊ·
È«ÎļìË÷µÄʵÏÖ£ºLueneÈ«ÎÄË÷ÒýºÍÊý¾Ý¿âË÷ÒýµÄ±È½Ï
ÖÐÎÄÇзִʻúÖƼò½é£º»ùÓÚ´Ê¿âºÍ×Ô¶¯ÇзִÊËã·¨µÄ±È½Ï
¾ßÌåµÄ°²×°ºÍʹÓüò½é£ºÏµÍ³½á¹¹½éÉܺÍÑÝʾ
Hacking Lucene£º¼ò»¯µÄ²éѯ·ÖÎöÆ÷£¬É¾³ýµÄʵÏÖ£¬¶¨ÖƵÄÅÅÐò£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ