Created
February 16, 2012 12:02
-
-
Save SyncHack/1844363 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_old() { | |
String ret = ""; | |
InputStream in = null; | |
byte[] buf = new byte[4096]; | |
try { | |
String[] args = { | |
"/system/bin/cat", "/proc/cpuinfo" | |
}; | |
Process process = new ProcessBuilder(args).start(); | |
in = process.getInputStream(); | |
int len = in.read(buf); | |
if (len > 0) { | |
ret = new String(buf, 0, len); | |
} | |
} catch (IOException ioe) { | |
// ioe.printStackTrace(); | |
} finally { | |
try { | |
if (in != null) { | |
in.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