private int unpack32bits(byte[] array, int offset) { int num = 0; for (int i = 0; i < 4; i++) { num += array [offset + i] << (i * 8); } return num; }