Question: Using Scala Sys Process

Question

Using Scala Sys Process

Answers 1
Added at 2017-09-07 18:09
Tags
Question

is there a way to retrieve the actual java inputStream that correspond to the stdout of the java process being executed, when using ProcessBuilder or anything else in the package ?

Answers to

Using Scala Sys Process

nr: #1 dodano: 2017-09-07 19:09

Sure, just "use java":

import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader

object Main {
  def main(args: Array[String]) {
    var br: BufferedReader = null
    try {
      br = new BufferedReader(new InputStreamReader(System.in))
      while (true) {
        val input = br.readLine()
      }
    } finally {
      br.close()
    }
  }
}
Source Show
◀ Wstecz