import java.io.*;
class RanAccFile{
public static void main (String args[]) throws IOException{
RandomAccessFile ObjRW=new RandomAccessFile("RanData.txt","rw");
System.out.println("¢éÍÁÙÅ·ÕèÍèÒ¹ä´é¡è͹à¾ÔèÁ->"+ObjRW.readLine());
System.out.println("¢¹Ò´¢éÍÁÙÅ·Ñé§ËÁ´¡è͹à¾ÔèÁ->"+ObjRW.length()+"\n");
ObjRW.writeBytes("A random access file behaves like a large array of bytes stored in the file system");
ObjRW.seek(0);
System.out.println("¢éÍÁÙÅ·ÕèÍèÒ¹ä´éËÅѧà¾ÔèÁ->"+ObjRW.readLine());
System.out.println("¢¹Ò´¢éͧÁÙÅ·Ñé§ËÁ´ËÅѧà¾ÔèÁ->"+ObjRW.length()+"\n");
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น