SyntaxFix
Write A Post
Hire A Developer
Questions
Alternatively, you can use Guava's Resources object:
URL url = new URL("http://www.puzzlers.org/pub/wordlists/pocket.txt"); List<String> lines = Resources.readLines(url, Charsets.UTF_8); lines.forEach(System.out::println);