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
Post a Comment