Thank you William and Anayonkar.
Exactly how are you positioning at the end line of previous reading?
That is not something possible with BufferedReader which would have to read the whole file, resulting in what you observe.
Since I used bufferedReader to read line by line, I have counter to remember the line number.
Also note that a Reader is going to be doing character by character conversion to UNICODE, an expensive operation.
Thank you. I did not know it, but I was wondering maybe it will be more efficient if I use stream. The reason i use bufferedReader is that it help to maitain the line by line format, when a line is read and it has keyword inside, it will be recorded with "\n" to the file, later it will be displayed on a browser and may need to send to email as well. so i do not know if i use stream, it will still easy to have this line format maintained.
Instead of just opening a file after a time interval, I would suggest something like checking last modified time. If file is not modified at all, there's no point in opening the file in first place.
Good point, i will add that.
I'm not sure which OS you are working with, but in Linux, this can simply be done by grep command. No need to even open a file using Java classes. On Windows, there might be something similar to it.
It is windows, it will be wonderful if it has such feature, but I am wondering if there is any.
Thanks again for the help!
Regards,