Ejemplo n.º 1
0
 private void dumpFailedLaunchInfo(Process process) {
   try {
     dumpStream(process.getErrorStream());
     dumpStream(process.getInputStream());
   } catch (IOException e) {
     MessageOutput.println("Unable to display process output:", e.getMessage());
   }
 }
Ejemplo n.º 2
0
 private void dumpStream(InputStream stream) throws IOException {
   BufferedReader in = new BufferedReader(new InputStreamReader(stream));
   int i;
   try {
     while ((i = in.read()) != -1) {
       MessageOutput.printDirect((char) i); // Special case: use
       //   printDirect()
     }
   } catch (IOException ex) {
     String s = ex.getMessage();
     if (!s.startsWith("Bad file number")) {
       throw ex;
     }
     // else we got a Bad file number IOException which just means
     // that the debuggee has gone away.  We'll just treat it the
     // same as if we got an EOF.
   }
 }