finished part 1

master
Flavien Haas 3 years ago
parent 089b6a04d0
commit db4cdcca54

Binary file not shown.

@ -9,17 +9,26 @@ public class AProcess {
// args is the command
ProcessBuilder pb = new ProcessBuilder(args);
Process process = pb.start();
// obtain the input and output streams
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
try {
Process process = pb.start();
// obtain the input and output streams
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ( (line = br.readLine()) != null)
System.out.println(line);
br.close();
} catch (IOException e) {
System.out.println(e);
}
String line;
while ( (line = br.readLine()) != null)
System.out.println(line);
br.close();
}
}

Loading…
Cancel
Save