日期:2014-05-16 浏览次数:20820 次
转自:http://zhidao.baidu.com/question/322007540.html?fr=qrl&cid=870&index=1&fr2=query
?
http://blog.sina.com.cn/s/blog_3ec48433010001en.html
?
实例:
public class TestIOapp{ public static void main(String [] args) throws IOException{ RandomAccessFile file = new RandomAccessFile("test.txt","rw"); file.writeBoolean(true); file.writeInt(123456); file.writeInt(7890); file.writeLong(1000000); file.writeInt(777); file.writeFloat(.0001f); file.seek(5); System.out.println(file.readInt()); } } A.123456 B.7890 C.1000000 D.777 E.0001
?
解答: