Guest User

Untitled

a guest
Feb 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. //import java.io.ByteArrayInputStream
  2. import java.io.{BufferedReader,InputStreamReader}
  3.  
  4. object A {
  5. def main(a: Array[String]) {
  6. for (i <- 0 until 10) {
  7. println("hello " + i)
  8. }
  9. val ls = Runtime.getRuntime.exec("ls -l")
  10. var in = ls.getInputStream
  11. // in = new ByteArrayInputStream("abc\n".getBytes())
  12. val re = new BufferedReader(new InputStreamReader(in))
  13. var s = null: String
  14. while ({ s = re.readLine; s != null}) {
  15. println(s)
  16. }
  17. }
  18. }
Add Comment
Please, Sign In to add comment