Skip to content

Instantly share code, notes, and snippets.

@jaydonnell
Created September 17, 2009 23:43
Show Gist options
  • Save jaydonnell/188788 to your computer and use it in GitHub Desktop.
Save jaydonnell/188788 to your computer and use it in GitHub Desktop.
int count = Files.readLines(
new File("/path/to/file"),
Charsets.UTF_8, // remember that? :)
new LineProcessor<Integer>() {
int count = 0;
public boolean processLine(String line) {
count++;
}
public Integer getResult() { return count; }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment