I mean this library: http://sourceforge.net/projects/streamsupport/
It must be compatible with Java8 threads, so I tried to run some examples from Java8 docs, for example:
IntStream.range(1, 4).forEach(System.out::println);
But .range is not defined anywhere. From this library documentation:
streamsupport is the backport of the Java 8 interface java.util.function (functional interfaces) and java.util.stream (streams) for Java 6 or 7 users supplemented with selected add-ons from java.util.concurrent, t exists in Java 6.
But: - I can not find a single example of how to use this backported library - As you can see, I also can not use even the simplest script from Java8.
Can someone give me an example of how to use backported StreamSupport or some documentation link?
[edit]
import java8.util.function.Consumer;
IntStreams.range(1, 4).forEach(new Consumer<Integer>(){
public void accept(Integer next){
System.out.println(next);
}
});
Error message:
Error: (126, 35) error: the method for each in the IntStream interface cannot be applied to these types; required: IntConsumer found:> reason: actual argument> cannot be converted to IntConsumer using call conversion
If I change Consumer to IntConsumer:
Error: (127, 59) error: type IntConsumer does not accept parameters
source
share