Skip to content

Instantly share code, notes, and snippets.

@SyncHack
Created February 16, 2012 12:07
Show Gist options
  • Save SyncHack/1844389 to your computer and use it in GitHub Desktop.
Save SyncHack/1844389 to your computer and use it in GitHub Desktop.
String getRawCpuinfo() {
String ret = "";
FileReader fr = null;
char[] buf = new char[4096];
try {
fr = new FileReader("/proc/cpuinfo");
int len = fr.read(buf);
if (len > 0) {
ret = new String(buf, 0, len);
}
} catch (IOException ioe) {
// ioe.printStackTrace();
} finally {
try {
if (fr != null) {
fr.close();
}
} catch (IOException ioe) {
// ioe.printStackTrace();
}
}
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment