JAVAÄÚ´æÎļþÓ³Éä
ÓÐÈçÏÂÇé¿öÏ¿ÉÒÔÓõ½ÄÚ´æÎļþÓ³Éä¼¼Êõ½â¾öÎÊÌâ:
1.²»Òª¸´ÖÆÎļþÖÐËùÓеÄÊý¾Ý£¬Ö»ÐèÒªÐÞ¸ÄÎļþÖоֲ¿µÄÊý¾Ý¡£
2.²¢ÐÐ\·Ö¶Î´¦Àí´óÎļþ¡£
ÈçÏ´úÂëʾʹÓÃjavaNIO¾Ö²¿ÐÞ¸ÄÎļþÖÐÖ¸¶¨Î»ÖõIJ¿·ÖÊý¾Ý£º
Java´úÂë
/**
* ÐÞ¸ÄÎļþÖеÄijһ²¿·ÖµÄÊý¾Ý²âÊÔ:½«×Ö¶¨Î»ÖõÄ×Öĸ¸ÄΪ´óд
* @param fName :ÒªÐ޸ĵÄÎļþÃû×Ö
* @param start:Æðʼ×Ö½Ú
* @param len:ÒªÐ޸ĶàÉÙ¸ö×Ö½Ú
* @return :ÊÇ·ñÐ޸ijɹ¦
* @throws Exception:Îļþ¶ÁдÖпÉÄܳöµÄ´í
* @author javaFound
*/
public static boolean changeFile(String fName,int start,int len) throws Exception{
//´´½¨Ò»¸öËæ»ú¶ÁдÎļþ¶ÔÏó
java.io.RandomAccessFile raf=new java.io.RandomAccessFile(fName,"rw");
long totalLen=raf.length();
System.out.println("Îļþ×ܳ¤×Ö½ÚÊÇ: "+totalLen);
//´ò¿ªÒ»¸öÎļþͨµÀ
java.nio.channels.FileChannel channel=raf.getChannel();
//Ó³ÉäÎļþÖеÄijһ²¿·ÖÊý¾ÝÒÔ¶Áдģʽµ½ÄÚ´æÖÐ
java.nio.MappedByteBuffer buffer= channel.map(FileChannel.MapMode.READ_WRITE, start, len);
//ʾÀýÐÞ¸Ä×Ö½Ú
&nb
Ïà¹ØÎĵµ£º
¹«Ë¾ÒµÎñ¼±ËÙÀ©ÕÅ£¬¼±ÐèÓвÅÄܵÄͬѧ¼ÓÈëµ½ÎÒÃǵÄÐÐÁÐÖУ¬
×îºÃÄã¶Ô¹¤×÷»ý¼«£¬ÈÏÕæ£¬¸ºÔð
×îºÃÄãÒѾÓÐÔúʵµÄ±à³Ì»ù´¡
×îºÃÄãÒѾÊìÁ·ÕÆÎÕJava¼¼Êõ
×îºÃÄãÖÁÉÙÒÑÓÐÒ»£¬Á½Ä깤×÷¾Ñé
¹¤×÷µØµã£ºº¼ÖÝ
ְλ £ºJava¿ª·¢¹¤³Ìʦ£¨°¢Àï°Í°Í¼¯ÍÅB2B¹«Ë¾ÍøÕ¾¼¼Êõ²¿£©
ÓÐÒâÕßÇë°Ñ ......
*******************************************************************************************************
Filename: ftp.java
Author: leetsing(elove)
Create date: 2004-08-30
Use: connect to FTP server,then upload and download file
Modify date: 2004-09-05 add to upload file
2004-09-13 add to downl ......
String ¶ÔÏóÊDz»¿É¸Ä±äµÄ¡£Ã¿´ÎʹÓà System.String ÀàÖеķ½·¨Ö®Ò»Ê±£¬¶¼ÒªÔÚÄÚ´æÖд´½¨Ò»¸öеÄ×Ö·û´®¶ÔÏó£¬Õâ¾ÍÐèҪΪ¸ÃжÔÏó·ÖÅäеĿռ䡣ÔÚÐèÒª¶Ô×Ö·û´®Ö´ÐÐÖØ¸´Ð޸ĵÄÇé¿öÏ£¬Óë´´½¨Ð嵀 String ¶ÔÏóÏà¹ØµÄϵͳ¿ªÏú¿ÉÄÜ»á·Ç³£°º¹ó¡£Èç¹ûÒªÐÞ¸Ä×Ö·û´®¶ø²»´´½¨ÐµĶÔÏó£¬Ôò¿ÉÒÔʹÓà System.Text.StringBuilder Àà¡£ÀýÈ ......
java se£º
1.javaºËÐļ¼Êõ£¨µÚÆß°æ£©£¨ºÜºÃµÄÈëÃÅÊé¼®£¬ÓÐÁ½±¾£©
2.java±à³Ì˼Ï루µÚËİ棩£¨ÎÒ¿´¹ýµÚÈý°æ£¬µÚËİ濴ÁËÒ»µãÓ¢Îĵ쬾õµÃÕâ±¾Ê黹ÊÇÊʺÏÓлù´¡µÄjavaѧϰÕß¹®¹Ì»ù´¡£¬Ò²¾ÍÊÇ˵ҪÏë´òÀλù´¡¾Í¿´ÍêºËÐļ¼Êõ¿´Õâ¸ö~£©
3.java jdkʵÀý±¦µä£¨Õâ±¾ÊéÀX±¾°üº¬ÁËËùÓÐÓï·¨µÄÀý³Ì£©
4.java se6.0±à³ÌÖ¸ÄÏ£¨ºñʵ ......
Object serializationµÄ¶¨Ò壺
Object serialization ÔÊÐíÄ㽫ʵÏÖÁËSerializable½Ó¿ÚµÄ¶ÔÏóת»»Îª×Ö½ÚÐòÁУ¬ÕâЩ×Ö½ÚÐòÁпÉÒÔ±»ÍêÈ«´æ´¢ÒÔ±¸ÒÔºóÖØÐÂÉú³ÉÔÀ´µÄ¶ÔÏó¡£
serialization²»µ«¿ÉÒÔÔÚ±¾»ú×ö£¬¶øÇÒ¿ÉÒÔ¾ÓÉÍøÂç²Ù×÷£¨RMI£©¡£Õâ¸öºÃ´¦ÊǺܴóµÄ----ÒòΪËü×Ô¶¯ÆÁ±ÎÁ˲Ù×÷ϵͳµÄ²îÒ죬×Ö½Ú˳Ðò£¨ÓÃUnixϵÄc¿ª·¢¹ýÍ ......