Skip to content

Instantly share code, notes, and snippets.

Created June 11, 2011 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1020244 to your computer and use it in GitHub Desktop.
Save anonymous/1020244 to your computer and use it in GitHub Desktop.
private long[] getMatchInfo(byte[] rawBytes) {
final int bytesPerInt = 4;
long[] matchInfo = new long[rawBytes.length/bytesPerInt];
for (int i = 0; i < rawBytes.length; i+= bytesPerInt) {
long value = 0;
for (int z = 0; z < bytesPerInt; z++) {
value += (rawBytes[i + z] & 0xff) << (8 * z);
}
matchInfo[i/bytesPerInt] = value;
}
return matchInfo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment