Creates a new instance of ProcessWatcher toWatch = p;
toWatch = p;
if (is.available()>0) { byte[] bytes = new byte[is.available()]; is.read(bytes, 0, bytes.length); System.out.println(new String(bytes)); }
InputStream input = toWatch.getInputStream(); InputStream error = toWatch.getErrorStream(); boolean notDone = true; do { try { while (input.available()>0) { dump(input); } while (error.available()>0) { dump(error); } } catch(IOException e) { } try { toWatch.exitValue(); notDone = false; } catch(IllegalThreadStateException e) { } } while (notDone); return toWatch.exitValue();