Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void useStreams(String filePath) throws IOException {
- long startTime = new Date().getTime();
- Files.lines(Paths.get(filePath))
- .map(line -> line.split("\\t"))
- .forEach(fields -> addStateToCity(fields[3], fields[4]));
- System.out.println("Streams took: " + (new Date().getTime() - startTime) + " ms.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement