How can I create a stream from an array?
You can use Arrays.stream E.g. Arrays.stream(array); You can also use Stream.of as mentioned by @fge , which looks like public static<T> Stream<T> of(T… values) { return Arrays.stream(values); } But note Stream.of(intArray) will return Stream<int[]> whereas Arrays.stream(intArr) will return IntStream providing you pass an array of type int[]. So in a nutshell for primitives type you … Read more