code: public static int bytesToInt(byte[] bytes) {
          int value = ((int) bytes[0] & 0xFF) << 24;
          value += ((int) bytes[1] & 0xFF) << 16;
          value += ((int) bytes[2] & 0xFF) << 8;
          value += (int) bytes[3] & 0xFF;
          return value;
      }
docs: 4 bytes array to int