Skip to content
Mahmoud Ben Hassine edited this page Nov 8, 2015 · 3 revisions

sort

Synopsis

Sorts a stream in the natural order of its elements.

This is an alias for sorted.

Parameters

N/A

Example

Stream<String> stream = Stream.of("b", "a", "c");

UnixStream.unixify(stream)
   .sort()
   .to(stdOut()); // prints "a", "b", "c"

// Or

UnixStream.from(stream)
   .pipe(sort())
   .to(stdOut()); // prints "a", "b", "c"