如何从文件读固定格式的数据,像在C中一样.急!在线...............

sethyhm 2004-05-03 10:57:25
我要从一个文件中的每一行读一些数据,然后呢,这些行中的数据以空格或者TAB分隔,数据可以是int,float,double,char的混和,JAVA中有这样已经写好的函数吗????
...全文
41 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ac669 2004-05-04
  • 打赏
  • 举报
回复
java.io
Class DataInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--java.io.DataInputStream

All Implemented Interfaces:
DataInput



int read(byte[] b)
Reads some number of bytes from the contained input stream and stores them into the buffer array b.
int read(byte[] b, int off, int len)
Reads up to len bytes of data from the contained input stream into an array of bytes.
boolean readBoolean()
See the general contract of the readBoolean method of DataInput.
byte readByte()
See the general contract of the readByte method of DataInput.
char readChar()
See the general contract of the readChar method of DataInput.
double readDouble()
See the general contract of the readDouble method of DataInput.
float readFloat()
See the general contract of the readFloat method of DataInput.
void readFully(byte[] b)
See the general contract of the readFully method of DataInput.
void readFully(byte[] b, int off, int len)
See the general contract of the readFully method of DataInput.
int readInt()
See the general contract of the readInt method of DataInput.


...
dogcai 2004-05-04
  • 打赏
  • 举报
回复
当然你所使用的这个文档也要用相应的输入流操纵。。
dogcai 2004-05-04
  • 打赏
  • 举报
回复
楼主可以用ObjectFileWriter或者DataOutputStream。。这两种类里面提供不同得数据写入和写出的功能。。你看一下帮助文档就明白我的意思了。。
sean_gao 2004-05-03
  • 打赏
  • 举报
回复
RandomAccessFile?
内容概要:本文介绍了SICK公司生产的LRS4581R-230001型激光扫描仪的技术参数与产品特性。该设备适用于室内外环境,采用886 nm红外光源,符合激光安全等级1级标准,具备360°水平开启角度和多种可调角度分辨率(最低0.02°),扫描频率可达25 Hz。其工作距离可达300 m,对不同反射率物体的有效扫描范围分别为250 m(90%漫反射)和80~100 m(10%漫反射)。设备配备自加热功能,可在-30 °C至+50 °C环境下稳定运行,防护等级达IP65/IP67,适应恶劣工业条件。支持Ethernet(TCP/IP、UDP/IP)、数字I/O及编码器输入接口,便于系统集成。内置多种滤波器和区域评估功能,提升数据准确性。附带推荐配件信息及安装指南,方便实际部署。; 适合人群:工业自动化工程师、系统集成商、从事智能传感技术研发的专业技术人员,以及需要高精度远程测距与环境感知解决方案的设计人员; 使用场景及目标:①用于户外或室内复杂环境下的精确轮廓检测、障碍物识别与定位;②集成于AGV、自动驾驶车辆、港口机械、堆垛机等移动设备实现导航与避障;③应用于建筑测绘、地形扫描、安全监控等远距离测量任务; 阅建议:此资料为技术规格说明书,建议结合具体工程项目需求查阅关键参数,重点关注扫描性能、环境适应性及接口配置,以便正确选型与集成应用。

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧