Wednesday, October 29, 2008

Result of Process to String


Process p = Runtime.getRuntime().exec(...);
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
StringBuffer sb = new StringBuffer();
String line;
while ((line = br.readLine()) != null) {
sb.append(line).append("\n");
}
String answer = sb.toString();


Original at here

No comments: