What is the advantage of forking a stream over just using multiple streams? What is the advantage of forking a stream over just using multiple streams? multithreading multithreading

What is the advantage of forking a stream over just using multiple streams?


For me this doesn't make much sense with an array list as stream source.

If the stream source is a big file that you process with

StreamForker<Person> forker = new StreamForker<>(    java.nio.file.Files.lines(Paths.get("somepath"))        .map(Person::new))    .fork(...)

then it could prove beneficial since you would process the whole file only once, whereas with three seperat calls to Files.lines(...) you would read the file three times.