RandomAccessFile 文本随机读写

    xiaoxiao2026-03-18  7

    java.io. RandomAccessFile 随机读写文件的类。 long java.io.RandomAccessFile. length() throws IOException 返回文件的大小,单位字节。 Returns the length of this file. int java.io.RandomAccessFile. skipBytes(int n) throws IOException 读游标向后移动n字节。 Attempts to skip over n bytes of input discarding the skipped bytes.  void java.io.RandomAccessFile. seek(long pos) throws IOException 设置文件游标相对于文件开头的偏移量。 Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.  long java.io.RandomAccessFile. getFilePointer() throws IOException 返回当前游标的偏移量。 Returns the current offset in this file. String java.io.RandomAccessFile. readLine() throws IOException 从当前位置读一行,返回String。 Reads the next line of text from this file 相关资源:RandomAccessFile随机文本,使用多线程处理
    最新回复(0)