public String readProcessStat(int pid){
  RandomAccessFile reader=null;
  String line=null;
  try {
    reader=new RandomAccessFile("/proc/" + pid + "/stat","r");
    line=reader.readLine();
  }
 catch (  IOException ex) {
    ex.printStackTrace();
  }
 finally {
  }
  return line;
}

public String readProcessStat ( int pid ) { RandomAccessFile reader = null ; String line = null ; try { reader = new RandomAccessFile ( "/proc/" + pid + "/stat" , "r" ) ; line = reader . readLine ( ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; } finally { } return line ; }
return the first line of / proc / pid / stat or null if failed .
