Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //import java.io.ByteArrayInputStream
- import java.io.{BufferedReader,InputStreamReader}
- object A {
- def main(a: Array[String]) {
- for (i <- 0 until 10) {
- println("hello " + i)
- }
- val ls = Runtime.getRuntime.exec("ls -l")
- var in = ls.getInputStream
- // in = new ByteArrayInputStream("abc\n".getBytes())
- val re = new BufferedReader(new InputStreamReader(in))
- var s = null: String
- while ({ s = re.readLine; s != null}) {
- println(s)
- }
- }
- }
Add Comment
Please, Sign In to add comment