How to read a file from a certain offset in Java?

前端 未结 2 1889
难免孤独
难免孤独 2020-11-27 20:27

Hey I\'m trying to open a file and read just from an offset for a certain length! I read this topic: How to read a specific line using the specific line number from a file

2条回答
  •  感情败类
    2020-11-27 20:57

    RandomAccessFile exposes a function:

    seek(long pos) 
              Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.
    

提交回复
热议问题