2013年5月9日

使用RandomAccessFile文本文件倒置读出

摘要: import java.io.*;public class H{public static void main(String args[]){ File f=new File("time.txt"); try{ RandomAccessFile random=new RandomAccessFile(f,"rw"); //以随机读取方式打开文件 random.seek(0); long m=random.length(); //m = 文件长度 while (m >= 0){ m--; //每次循环m都减1,等于从后往前 random.seek(m 阅读全文

posted @ 2013-05-09 16:57 @冰糖 阅读(2078) 评论(0) 推荐(0) 编辑

导航