?? appendcontent.java
字號(hào):
import java.io.*;
/**
* Description:
* <br/>Copyright (C), 2005-2008, Yeeku.H.Lee
* <br/>This program is protected by copyright laws.
* <br/>Program Name:
* <br/>Date:
* @author Yeeku.H.Lee kongyeeku@163.com
* @version 1.0
*/
public class AppendContent
{
public static void main(String[] args)
{
RandomAccessFile raf = null;
try
{
//以讀、寫方式打開一個(gè)RandomAccessFile對(duì)象
raf = new RandomAccessFile("out.txt" , "rw");
//將記錄指針移動(dòng)的out.txt文件的最后
raf.seek(raf.length());
raf.write("追加的內(nèi)容!\r\n".getBytes());
}
catch (IOException ex)
{
ex.printStackTrace();
}
finally
{
try
{
if (raf != null)
{
raf.close();
}
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -