![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e90. Reading Output from a Commandtry { // Execute command String command = "ls"; Process child = Runtime.getRuntime().exec(command); // Get the input stream and read from it InputStream in = child.getInputStream(); int c; while ((c = in.read()) != -1) { process((char)c); } in.close(); } catch (IOException e) { }
e91. Sending Input to a Command
© 2002 Addison-Wesley. |