Created
February 16, 2012 12:07
-
-
Save SyncHack/1844389 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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