Advertisement
Guest User

Untitled

a guest
May 30th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. private static void useStreams(String filePath) throws IOException {
  2.  
  3. long startTime = new Date().getTime();
  4.  
  5. Files.lines(Paths.get(filePath))
  6. .map(line -> line.split("\\t"))
  7. .forEach(fields -> addStateToCity(fields[3], fields[4]));
  8.  
  9. System.out.println("Streams took: " + (new Date().getTime() - startTime) + " ms.");
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement