Saturday, 15 February 2014

text - Does Scanner in Java block on file input? -



text - Does Scanner in Java block on file input? -

i'm coding log reader should scan log file currently beingness written to , upload info server. file changes every hour. wondering if next() method in scanner blocks end of file standard input. couldn't find info online in google search.

thank you.

technically right answer: yes, scanner uses standard io calls may block on input. when info unavailable end of file has not been reached. case if reading socket.

the reply looking for: in circumstances describing, scanner not block because has reached end of file. if file might written in future, eof generated when seek read end of file.

java text io

No comments:

Post a Comment