How can I reverse a Java 8 stream and generate a decrementing IntStream of values?
For the specific question of generating a reverse IntStream, try something like this: static IntStream revRange(int from, int to) { return IntStream.range(from, to) .map(i -> to – i + from – 1); } This avoids boxing and sorting. For the general question of how to reverse a stream of any type, I don’t know of … Read more