I was trying to read from a file between two specific indices using the RandomAccessFile.
I know I can jump to an index with the seek()
function, but i couldn't find the answer how to read then text out of the file until a specific index.
For example i have a huge file and i want to read text from index 100 to index 500, i would start like this:
public String get_text(){
raf.seek(100) //raf= my RandomAccessFile
String txt=raf.read(500) //read until index 500 which i don't know how to do
return txt;
}
Please help me :)