高手看看这个方法的作用是什么,我老大说传进去一个Linux指令可以返回得到字符串,可是我看不懂  
public static String execCommand(String command) throws RuntimeException
{
Process process = null;
try
{
process = Runtime.getRuntime().exec(command);
InputStreamReader ir = new InputStreamReader(process.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String msg = "";
String line = null;
while ((line = input.readLine()) != null)
{
    msg = msg + line;
}
String error = "";
ir = new InputStreamReader(process.getErrorStream());
input = new LineNumberReader(ir);
while ((line = input.readLine()) != null)
{
error = error + line;
}
if( error.length() >0 ){
throw new RuntimeException(error);
}
return msg;
}
catch (IOException e)
{
e.printStackTrace();
throw new RuntimeException(e);
}

}