Created
April 4, 2015 14:52
-
-
Save hhariri/4d66e93053fd45e274f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Without it | |
ObservableHttp.createRequest(HttpAsyncMethods.createGet(url), client) | |
.toObservable() | |
.flatMap({ response -> response.getContent().map { | |
byte -> | |
String(byte) | |
} | |
}) | |
.toBlocking() | |
.forEach { | |
data -> println(data) | |
} | |
} | |
// With it | |
ObservableHttp.createRequest(HttpAsyncMethods.createGet(url), client) | |
.toObservable() | |
.flatMap({ | |
it.getContent().map { | |
String(it) | |
} | |
}) | |
.toBlocking() | |
.forEach { | |
println(it) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment