Read a file while it's being written
问题 I have to read the tomcat log file,and after some time(for example:one hour) I will read the file again(just for the new added content),so I create the RandomAccessFile to record the last postion I completed,and use the BufferedReader.readLine() method. However,I found that sometime I can not read the whole line of the file. For example,the tomcat is tring to write the following content(just example): 192.168.0.0 localhost /index.html ..... And at this moment,when I read I may get the result