finished part 1
This commit is contained in:
parent
089b6a04d0
commit
db4cdcca54
Binary file not shown.
Binary file not shown.
@ -9,17 +9,26 @@ public class AProcess {
|
|||||||
|
|
||||||
// args is the command
|
// args is the command
|
||||||
ProcessBuilder pb = new ProcessBuilder(args);
|
ProcessBuilder pb = new ProcessBuilder(args);
|
||||||
Process process = pb.start();
|
|
||||||
|
|
||||||
// obtain the input and output streams
|
try {
|
||||||
InputStream is = process.getInputStream();
|
Process process = pb.start();
|
||||||
InputStreamReader isr = new InputStreamReader(is);
|
|
||||||
BufferedReader br = new BufferedReader(isr);
|
// 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…
Reference in New Issue
Block a user