[java] How can I get the count of line in a file in an efficient way?