static void SetInt(int x, byte[] arr, int offset) { for (int i = 0; i < 4; i++) { arr[offset+i] = (byte)((x >> (i * 8)) & 0xFF); } }