Created
December 15, 2017 03:26
-
-
Save idletekz/be39cd21fce78cf0b2312470f320b3df to your computer and use it in GitHub Desktop.
This file contains hidden or 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
ProcessBuilder builder = new ProcessBuilder( myCommand.split(' ') ) | |
builder.redirectErrorStream(true) | |
Process process = builder.start() | |
InputStream stdout = process.getInputStream () | |
BufferedReader reader = new BufferedReader (new InputStreamReader(stdout)) | |
content = "" | |
while ((line = reader.readLine ()) != null) { | |
System.out.println ("Stdout: " + line) | |
content += line | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment