List of usage examples for java.util.stream StreamSupport longStream
public static LongStream longStream(Spliterator.OfLong spliterator, boolean parallel)
From source file:org.briljantframework.array.AbstractLongArray.java
@Override public LongStream stream() { PrimitiveIterator.OfLong ofLong = new PrimitiveIterator.OfLong() { public int current = 0; @Override//from w w w . j ava 2s . c o m public long nextLong() { return get(current++); } @Override public boolean hasNext() { return current < size(); } }; Spliterator.OfLong spliterator = Spliterators.spliterator(ofLong, size(), Spliterator.SIZED); return StreamSupport.longStream(spliterator, false); }