Open riclava opened 8 years ago
thanks! it's not the best way! maybe!
public final static int countLines(File file) {
try(LineNumberReader rf = new LineNumberReader(new FileReader(file))){
long fileLength = file.length();
rf.skip(fileLength);
return rf.getLineNumber();
} catch (IOException e) {
e.printStackTrace();
}
return 0;
}
these code works