Skip to content

Instantly share code, notes, and snippets.

@SyncHack
Created February 16, 2012 12:02
Show Gist options
  • Save SyncHack/1844363 to your computer and use it in GitHub Desktop.
Save SyncHack/1844363 to your computer and use it in GitHub Desktop.
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