Last active
December 30, 2015 10:20
-
-
Save gakuzzzz/339f0118e301ff2953c2 to your computer and use it in GitHub Desktop.
Enumerator to InputStream
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
val enumerator: Enumerator[Array[Byte]] = ... | |
val pos = new PipedOutputStream() | |
val pis = new PipedInputStream(pos) | |
Future { useInputStream(pis) } | |
val it = Iteratee.foreach(pos.write) | |
enumerator.onDoneEnumerating(pos.close()) |>>> it | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment