Skip to content

Instantly share code, notes, and snippets.

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

  • Save GaetanoPiazzolla/87ffe467e579cd86d25bf08201eee4d0 to your computer and use it in GitHub Desktop.

Select an option

Save GaetanoPiazzolla/87ffe467e579cd86d25bf08201eee4d0 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> searchStream() {
InputStream inputStream = new FileInputStream(pathFile);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
Stream<String> linesStream = bufferedReader.lines();
return linesStream.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