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

JAVA½«ÄÚÈÝ×·¼Óµ½Îļþβ²¿

import java.io.FileWriter;
import java.io.IOException;
import java.io.RandomAccessFile;
/**
 * ½«ÄÚÈÝ×·¼Óµ½Îļþβ²¿
 */
public class AppendToFile
{
    /**
     * A·½·¨×·¼ÓÎļþ£ºÊ¹ÓÃRandomAccessFile
     *
     * @param fileName
     *                ÎļþÃû
     * @param content
     *                ×·¼ÓµÄÄÚÈÝ
     */
    public static void appendMethodA(String fileName, String content)
    {
 try
 {
     // ´ò¿ªÒ»¸öËæ»ú·ÃÎÊÎļþÁ÷£¬°´¶Áд·½Ê½
     RandomAccessFile randomFile = new RandomAccessFile(fileName, "rw");
     // Îļþ³¤¶È£¬×Ö½ÚÊý
     long fileLength = randomFile.length();
     // ½«Ð´ÎļþÖ¸ÕëÒƵ½Îļþβ¡£
     randomFile.seek(fileLength);
     randomFile.writeBytes(content);
     randomFile.close();
 }
 catch (IOException e)
 {
     e.printStackTrace();
 }
    }
    /**
     * B·½·¨×·¼ÓÎļþ£ºÊ¹ÓÃFileWriter
     *
     * @param fileName
     * @param content
     */
    public static void appendMethodB(String fileName, String content)
    {
 try
 {
     // ´ò¿ªÒ»¸öдÎļþÆ÷£¬¹¹Ô캯ÊýÖеĵڶþ¸ö²ÎÊýtrue±íʾÒÔ×·¼ÓÐÎʽдÎļþ
     FileWriter writer = new FileWriter(fileName, true);
     writer.write(content);
     writer.clos


Ïà¹ØÎĵµ£º

java api ÏÖÔÚ

JAVAÔÚÏßapi
2009Äê06ÔÂ07ÈÕ 17:06
1.Hibernate API Documentation (3.2.2.ga)
http://www.hibernate.org/hib_docs/v3/api/
2.Spring Framework API 2.5
http://static.springframework.org/spring/docs/2.5.x/api/index.html
3.Struts 1.3.8 API
http://struts.apache.org/1.3.8/apidocs/index.html
4.Struts 2 Co ......

JAVA(Ò»)

1£® ¹ØÓÚ¶¯Ì¬¼ÓÔØ»úÖÆ?? 
ѧϰJava±ÈC++¸üÈÝÒ×Àí½âOOPµÄ˼Ï룬±Ï¾¹C++»¹»ìºÏÁ˲»ÉÙÃæÏò¹ý³ÌµÄ³É·Ö¡£ºÜ¶àÈ˶¼Äܱ³³öÀ´JavaÓïÑÔµÄÌص㣬ËùνµÄ¶¯Ì¬¼ÓÔØ»úÖƵȵȡ£µ±È»¸ÅÄîÍùÍùÊÇÏȼÇס¶øºóÏû»¯µÄ£¬¿ÉÓжàÉÙÈËÕæÕýÈ¥Ìå»á¹ý¶¯Ì¬¼ÓÔصĻúÖÆ£¬ÊÔͼȥѰÕÒ¹ýÆäÖеÄϸ½ÚÄØ?   Ìṩ´ó¼ÒÒ»¸ö·½·¨£º 
ÔÚÃüÁîÐд°¿ ......

JNBridge¿çÔ½JavaºÍ.Net´úÂë

ƾ½èJNBridge
¼¼Êõ£¬JavaºÍ.NET´úÂëÎÞÐè½»²æ±àÒë
Æ÷¾Í¿ÉÒÔʵÏÖ¶ÔÏó¹²Ïí¡£ËùÓÐJava´úÂëÔËÐÐÔÚJVMÉÏ£¬¶ø.NET´úÂëÔòÔËÐÐÔÚCLRÉÏ¡£Ôڸ÷½°¸Ï£¬JVMºÍCLR¿ÉÒÔÔËÐÐÔÚ²»Í¬µÄ»úÆ÷ÉÏ£¬Ò²¿ÉÒÔÔË
ÐÐÔÚһ̨»úÆ÷µÄ²»Í¬½ø³ÌÉÏ£¬ÉõÖÁ»¹ÄÜÔËÐÐÔÚÏàͬµÄ½ø³ÌÉÏ¡£´Ó¿ª·¢ÕߵĽǶÈÀ´¿´£¬ÔËÐÐÔÚÆäËûÐéÄâ»úÉϵĶÔÏó½ö½öÊÇ´úÀíµÄÔ¶³Ì¶ÔÏó¶øÒÑ¡£JN ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ