Skip to content

Commit 5f99903

Browse files
author
Mahmoud Ben Hassine
committed
update README.md
1 parent 1dee240 commit 5f99903

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ It provides a set of components that mimic Unix commands (and more).
1818

1919
# How to use it?
2020

21-
You can use UnixStream in two ways:
21+
You can use UnixStream in 3 ways:
2222

2323
#### 1. Either unixifiy your stream and process it the unix way:
2424

@@ -37,7 +37,7 @@ UnixStream.unixify(stream)
3737
// 2 baz
3838
```
3939

40-
#### 2. Or write your pipelines as you read them
40+
#### 2. Or write your pipelines as you read them:
4141

4242
```java
4343
// cat input.txt | grep a | sort | uniq | nl > output.txt
@@ -50,6 +50,18 @@ UnixStream.cat("input.txt")
5050
.to(file("output.txt"));
5151
```
5252

53+
#### 3. Or use functions and predicates provided by UnixStream with the standard Stream API:
54+
55+
```java
56+
Stream.of("1,foo", "2,bar")
57+
.filter(grep("a"))
58+
.map(cut(",", 2))
59+
.forEach(System.out::println);
60+
61+
//prints:
62+
//bar
63+
```
64+
5365
# Where to find it?
5466

5567
Add the following maven dependency to your project:

0 commit comments

Comments
 (0)