ʹÓÃJavaÔÚÎļþÀï²åÈëÒ»ÐÐ
ÔÚÎļþÀïÔö¼ÓÒ»ÐеÄΨһ·½·¨¾ÍÊǶÁÈ¡ÔʼÎļþ£¬È»ºóдÈëµ½Ò»¸öÁÙʱÎļþ£¬Í¬Ê±Ð´ÈëÒª²åÈëµÄÊý¾Ý¡£È»ºóɾ³ýÔʼÎļþ£¬ÔÙ°ÑÁÙʱÎļþ¸ÄÃûΪÔʼÎļþÃû¡£
package net.java2000.io;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class FileInsertRow {
public static void main(String args[]) {
try {
FileInsertRow j = new FileInsertRow();
j.insertStringInFile(new File(args[0]), Integer.parseInt(args[1]), args[2]);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* ÔÚÎļþÀïÃæµÄÖ¸¶¨ÐвåÈëÒ»ÐÐÊý¾Ý
*
* @param inFile
* Îļþ
* @param lineno
* ÐкÅ
* @param lineToBeInserted
* Òª²åÈëµÄÊý¾Ý
* @throws Exception
* IO²Ù×÷Òý·¢µÄÒì³£
*/
public void insertStringInFile(File inFile, int lineno, String lineToBeInserted)
throws Exception {
// ÁÙʱÎļþ
File outFile = File.createTempFile("name", ".tmp");
// ÊäÈë
FileInputStream fis = new FileInputStream(inFile);
BufferedReader in = new BufferedReader(new InputStreamReader(fis));
//
Ïà¹ØÎĵµ£º
*
Google App Engine¶ÔJavaÖ§³ÖÇé¿öÒ»ÀÀ
* http://developer.51cto.com 2009-04-09 11:06 ÑîÈü Òë 51CTO.com ÎÒÒªÆÀÂÛ(0)
Google App EngineµÄJavaÖ§³ÖÒÑ·¢²¼¡£´Ë´Î·¢²¼µÄÖصãÔÚÓÚÆäÖÐµÄ ......
ÐòÁл¯¾ÍÊǰѶÔÏóת»»ÎªÁ÷ÒÔ´æ´¢µ½Îļþ»ò´«Êä¸øÁíÒ»¸ö³ÌÐò£»·´ÐòÁл¯¾ÍÊÇ°ÑÁ÷ת»»Îª¶ÔÏó¡£JAVAµÄÐòÁл¯£¬ÊÇͨ¹ýÊÇjava.io.Serializable½Ó¿ÚÀ´ÊµÏֵġ£¸Ã½Ó¿Ú²»°üº¬Èκη½·¨£¬½ö±ê¼ÇÊÇ·ñ¿É±»ÐòÁл¯¡£¿ÉÐòÁл¯µÄÀ࣬Æä³ÉÔ±Ò²±ØÐëÊÇ¿ÉÐòÁл¯µÄ£¨Èç¹ûÓгÉÔ±²»Äܱ»ÐòÁл¯£¬Ôò±ØÐ뽫¸Ã±äÁ¿±ê¼ÇΪ£ºtransient£¨Ë²Ì¬£©£¬ÐòÁл¯Ê±£¬» ......
ÏàÐÅ´ó¼ÒƽʱÅöµ½¹ýһЩÔÚJAVAÖжÔͼÏñ½øÐд¦ÀíµÄÐèÇ󣬱ÈÈçÐèÒª¶ÔÉÏ´«µÄͼƬ¼ÓÉÏ×Ô¼ºµÄÇ©Ãû»òͼ±ê£¬»òÕßÉú³ÉºÍ½âÎö¶¯Ì¬µÄGIFͼƬ£¬ÒÔ¼°´¦ÀíPSDÎļþͼÏñÐÅÏ¢¡£±¾ÎľÍJAVAÔÚͼÏñ´¦ÀíÖÐһЩ»ù±¾Ó¦ÓýøÐÐÁ˽éÉÜ¡£Ï£Íûͨ¹ýÄܹ»¶Ô´ó¼ÒÔÚÒÔºóµÄͼÏñ´¦ÀíÖÐÓÐЩ°ïÖú¡£
Ò»¡¢¶ÔÒ»¸öÏÖÓеÄͼƬ½øÐÐÎÄ×ÖºÍͼ±êµÄºÏ³É
ÎÒÃÇÏÈ´ÓÏÂÃæµÄÕâ ......
1.1 ²»ÓÃnew¹Ø¼ü´Ê´´½¨ÀàµÄʵÀý
¡¡¡¡ÓÃnew¹Ø¼ü´Ê´´½¨ÀàµÄʵÀýʱ£¬¹¹Ô캯ÊýÁ´ÖеÄËùÓй¹Ô캯Êý¶¼»á±»×Ô¶¯µ÷Óᣵ«Èç¹ûÒ»¸ö¶ÔÏóʵÏÖÁËCloneable½Ó¿Ú£¬ÎÒÃÇ¿ÉÒÔµ÷ÓÃËüµÄclone()·½·¨¡£clone()·½·¨²»»áµ÷ÓÃÈκÎÀ๹Ô캯Êý¡£
¡¡¡¡ÔÚʹÓÃÉè¼Æģʽ£¨Design Pattern£©µÄ³¡ºÏ£¬Èç¹ûÓÃFactoryģʽ´´½¨¶ÔÏó£¬Ôò¸ÄÓÃclone()·½·¨´´½¨Ðµ ......
1. JavaScriptÊÇÒ»ÃÅ»ùÓÚ½âÊÍÐÔµÄÓïÑÔ£¬ËüºÍjavaÓïÑÔµÄÇø±ð£¿
²Î¿¼´ð°¸£ºjavaÓïÑÔÖбäÁ¿µÄÊý¾ÝÀàÐÍ×ÜÌå¿ÉÒÔ·ÖΪ£º»ù±¾Êý¾ÝÀàÐͺͶÔÏóÀàÐÍ¡£JSÓïÑÔÖеıäÁ¿ÊÇûÓÐÊý¾ÝÀàÐ͵ģ¬µ«ÊÇJSµÄ»ù±¾³ÌÐò¿ØÖƺÍjavaÊÇÒ»ÑùµÄÔÚJavaScriptÓïÑÔÖУ¬ËäÈ»±äÁ¿ÊÇûÓÐÊý¾ÝÀàÐÍ»òÕßÊÇÈôÊý¾ÝÀàÐ͵«ÊÇËûÃǵÄÖµÊÇÓÐÈýÖÖ»ù±¾Êý¾ÝÀàÐ͵ķֱðÊÇÊý×Ö¡ ......