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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -