Answers for "java get command line output"

-1

java get command line output

private static void GetOutput(final Process process) {
    new Thread() {
        public void run() {
            BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream()));
            String line = null; 
            try {
                while ((line = input.readLine()) != null) {
                    System.out.println(line);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }.start();
}
Posted by: Guest on June-13-2020

Code answers related to "java get command line output"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language