Given a file, we can transform it into a stream of strings using, e.g.,
Stream lines = Files.lines(Paths.get(\"input.txt\"))
Usually the standard input is read line by line, so what you can do is store all the read line into a collection, and then create a Stream that operates on it.
For example:
List allReadLines = new ArrayList();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String s;
while ((s = in.readLine()) != null && s.length() != 0) {
allReadLines.add(s);
}
Stream stream = allReadLines.stream();