I have an application that writes information to file. This information is used post-execution to determine pass/failure/correctness of the application. I'd like to be able to read the file as it is being written so that I can do these pass/failure/correctness checks in real time.
I assume it is possible to do this, but what are the gotcha's involved when using Java? If the reading catches up to the writing, will it just wait for more writes up until the file is closed, or will the read throw an exception at this point? If the latter, what do I do then?
My intuition is currently pushing me towards BufferedStreams. Is this the way to go? hey, as i'm facing a similar scenario i was wording if you have found a better solution than the accepted one?
以上就是How do I use Java to read from a file that is actively being written to?的详细内容，更多请关注web前端其它相关文章！