String getProcErrorOutput ( Process proc ) throws IOException { StringBuffer output = new StringBuffer ( ) ; InputStream procIn = proc . getInputStream ( ) ; int read ; // Dump the data printed by the process do { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; read = procIn . read ( buffer ) ; String s = new String ( buffer ) ; output . append ( s ) ; } while ( read == BUFFER_SIZE ) ; return output . toString ( ) ; }
Grabs the error message generated by executing the process .