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

head

Synopsis

Keeps the X first elements from a stream.

Parameters

Name Type Mandatory Default
size int No 10

Example

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

UnixStream.unixify(stream)
   .head(1)
   .to(stdOut()); // prints "a"

// Or

UnixStream.from(stream)
   .pipe(head(1))
   .to(stdOut()); // prints "a"
Clone this wiki locally