c*e
2 楼
怎么write?
我用DataInputStream in = new DataInputStream(new
FileInputStream("db-1x2.db"));
然后in.readByte()等读文件. 读到某一位置要写,怎么操作?
我用DataInputStream in = new DataInputStream(new
FileInputStream("db-1x2.db"));
然后in.readByte()等读文件. 读到某一位置要写,怎么操作?
c*t
3 楼
InputStream interface doesn't have the seek function. However, one
way dealing with seek is actually internally maintaining the position
counter. Then use skip() function to skip to the appropriate location.
Also, some InputStream support mark, but FileInputStream doesn't support
it.
In short, InputStream can "seek" used if your position seek is sequential.
However, if you need to seek backward, use RandomAccessFile, FileChannel,
etc.
【在 c******e 的大作中提到】
: 怎么write?
: 我用DataInputStream in = new DataInputStream(new
: FileInputStream("db-1x2.db"));
: 然后in.readByte()等读文件. 读到某一位置要写,怎么操作?
way dealing with seek is actually internally maintaining the position
counter. Then use skip() function to skip to the appropriate location.
Also, some InputStream support mark, but FileInputStream doesn't support
it.
In short, InputStream can "seek" used if your position seek is sequential.
However, if you need to seek backward, use RandomAccessFile, FileChannel,
etc.
【在 c******e 的大作中提到】
: 怎么write?
: 我用DataInputStream in = new DataInputStream(new
: FileInputStream("db-1x2.db"));
: 然后in.readByte()等读文件. 读到某一位置要写,怎么操作?
相关阅读
真诚求助 (JAVA校友录)如何获得类定义的public methods?急问:TOMCAT1.4.1+iis如何配置?JDBC vs Application ServerHow to access ActiveX control in JSP or EJB?getLocalHost() with multiple networkcard请各位对PETRI NET熟悉的大侠帮帮忙。我要急死了JSP 可以handle action 吗?土问题:一个文件路经的简单问题,帮帮忙how to normalize an image?Re: help with JTextAreaone java question如何查看加密的JAVASCRIPT源码?问题征解[转载] blackdown-jdk 和 sun-jdk哪个好?求教一个关于applet的问题two applet in one frame问个程序调用的问题faint, unreachable statement in javaChess Problem