To Stream.slice(fromInclusive, toExclusive) or Stream.slice(toSkip, limit) that is the question

Brian Goetz brian.goetz at
Fri Oct 11 10:34:02 PDT 2013

> If you have a non-indexed stream, why would you ever
> skip(start).limit(count) instead of simply limit(count)?

Here's one use case: Paging.  You've got a stream of results, and you 
want to display them by pages.

   Stream results = input.skip((pageNo-1)*pageSize).limit(pageSize);

More information about the lambda-libs-spec-experts mailing list