Created
January 17, 2018 16:19
-
-
Save frgomes/d074cd48904f023ee0c4d676a68c2a9a to your computer and use it in GitHub Desktop.
Scala - Create java.io.InputStream from String
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 lines = | |
Seq( | |
"Item,Qty,Price", | |
"Banana,1,0.50") | |
val text = lines.mkString("\n") | |
val stream: java.io.InputStream = new java.io.ByteArrayInputStream(text.getBytes(java.nio.charset.StandardCharsets.UTF_8.name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you