I have a text file like
one
two
three
four
five
I need to get the offset of each line in the file. How do I do this in Java?
I have searched through some of the I/O libraries(like BufferedReader and RandomAccessFile) but I'm unable to find a satisfactory answer to this.
Can anyone suggest how to deal with this?