Skip to content

Commit ce98a5b

Browse files
committed
add javadoc
1 parent eb9ecb9 commit ce98a5b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/main/java/com/github/davidmoten/rx/Checked.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,31 @@
99
/**
1010
* Utility functions that are useful for brevity when using checked exceptions
1111
* in lambdas with RxJava.
12+
*
13+
* <p>
14+
* Instead of
15+
* </p>
16+
*
17+
* <pre>
18+
* OutputStream os = ...;
19+
* Observable<String> source = ...;
20+
* source.doOnNext(s -> {
21+
* try {
22+
* os.write(s.getBytes());
23+
* } catch (IOException e) {
24+
* throw new RuntimeException(e);
25+
* }
26+
* })
27+
* .subscribe();
28+
* </pre>
29+
*
30+
* <p>
31+
* you can write:
32+
* </p>
33+
*
34+
* <pre>
35+
* source.doOnNext(Checked.a1(s -&gt; os.write(s.getBytes()))).subscribe();
36+
* </pre>
1237
*/
1338
public final class Checked {
1439

0 commit comments

Comments
 (0)