Skip to content

Instantly share code, notes, and snippets.

@GaetanoPiazzolla
Created September 18, 2021 11:15
Show Gist options
  • Select an option

  • Save GaetanoPiazzolla/8c961fedf515a402af2703f962f77bae to your computer and use it in GitHub Desktop.

Select an option

Save GaetanoPiazzolla/8c961fedf515a402af2703f962f77bae to your computer and use it in GitHub Desktop.
import java.util.stream.Stream;
import java.util.stream.Collectors;
import java.util.*;
public List<String> searchStreamParallel() {
return Files.readAllLines(Path.of(pathFile))
.parallelStream()
.filter(a -> a.contains(SEARCH_TOKEN))
.collect(Collectors.toList());
}
@GaetanoPiazzolla

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment