- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
随机文件操作(Random file operation)
随机文件操作(Random file operation)
The concept of random files:
Sequential file concept: read and write operations only in order.
Random file concept: the contents of a file are formatted (regular), so you can read data from different locations in the file.
1. RandomAccessFile (rtest.dat, RW);
RandomAccessFile creates a random file object that is associated with the file rtest.dat, which is readable and writable (RW). If the file exists, it opens the file. If it does not exist, the new file is opened and opened.
Eg:
RandomAccessFile, RF = new, RandomAccessFile (rtest.dat, RW);
The meaning of this statement: create the random file object RF and associate it with the file rtest.dat, which can be read and written. The file exists open, does not exist, then opens and opens.
2. RandomAccessFile (rtest.dat, R);
RandomAccessFile creates a random file object that is associated with the file rtest.dat, which is readable (R) and cannot overwrite the contents of the file. If the file exists, it opens the file. If it does not exist, the new file is opened and opened.
Eg:
RandomAccessFile, RF = new, RandomAccessFile (rtest.dat, R);
The meaning of this statement: create a random file object RF, and associated to file rtest.dat, the file can read can not write (ie: can not change the contents of the document). The file exists open, does not exist, then opens and opens.
3. rf.writeDouble (I * 1.1);
Write a double precision to the file, and move the offset backwards, moving 8 bytes (double precision counts 8 bytes). An operation that can only be performed in a writable readable state.
Reason by analogy:
Rf.writeInt (4); equal operation
4. rf.seek (int, Delta);
Set offsets for the purpose of reading or writing to a specific location.
5. rf.readDouble ();
Read a double precision number from the random file, and move the offset.
Double, D1, d2;
D1.rf.readDouble ();
D2.rf.readDouble ();
6. rf.close ();
When youre done, remember to close the random file.
Note: it is best to make the contents
您可能关注的文档
- 郭志辰大夫的《八穴》和《指灸》(Doctor Guo Zhichen's eight points and finger Moxibustion).doc
- 酒类产品能否直接做社区(Can liquor products be used directly as a community).doc
- 酒渣鼻强效液实践心得(Rosacea powerful solution experience).doc
- 酒类用语(英语)(Liquor usage (English)).doc
- 酒精危害中枢神经系统(Alcohol damages the central nervous system).doc
- 酒店厨房管理须知(Hotel kitchen management notes).doc
- 酒企强身--亟需高效人文营销非常1 1管理(Liquor prices to strengthen the body - the urgent need for efficient human marketing, very 11 management).doc
- 酒精肝 脂肪肝(Alcoholic liver fatty liver).doc
- 酒精肝与脂肪肝(Alcoholic liver and fatty liver).doc
- 酒精肝吃什么好(What's good for liver and liver).doc
- 随症加减用药(Drugs for modifying symptoms and symptoms).doc
- 隆力奇5实用保健常识 轻松获得健康身体(Lung nilfisk 5 practical health knowledge, easy access to healthy body).doc
- 隐形眼镜使用方法(Contact lens use method).doc
- 隐形眼镜危害大大滴(Contact lenses harm greatly).doc
- 隐形眼镜参数解释(Contact lens parameter interpretation).doc
- 隐形眼镜的健康使用(The healthy use of contact lenses).doc
- 隐形眼镜的分类(Classification of contact lenses).doc
- 隐形眼镜这么带(The contact lenses come with this).doc
- 隐形眼镜的销售(Contact lens sales).doc
- 除锈标准(Derusting standard).doc
最近下载
- 西门子PLC通讯.ppt VIP
- 在线网课学习课堂《研究生学术规范与学术诚信》单元测试考核答案.docx VIP
- 风力发电机组防腐规范.pdf VIP
- 卧式车床使用说明书.doc VIP
- 2025年八项规定精神纠正“四风”应知应会知识问答试题及答案详解(历年真题).docx VIP
- 广西桂林2021年中考语文现代文阅读真题.docx VIP
- 2018年10月注册土木工程师(水利水电工程)《专业知识考试(上)》真题及详解.doc VIP
- 疫苗采购管理制度.docx VIP
- 国家中医药管理局《中医药事业发展“十五五 ”规划》全文.docx
- 苏G02-2019 房屋建筑工程抗震构造设计.pdf VIP
文档评论(0)