file io - Handling write and read at the same time in java -


i have thread continuously logging file. have function getlines() when called return last 100 lines of log file.

my question whether implementing simple bufferedreader inside getlines() enough ? i'm concerned whether reading valid when write going on. don't mind missing few lines of code written during process of read though.

thanks

since java fileoutputstream / fileinputstream open files in shared mode reading not interfere writing. though in view better , more efficient implement logger holds last 100 written lines , returns them on demand.


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -