code: public static int bytesToInt(byte[] bytes, int offset) {
          // 
          int result = 0x00000000;
  
          int length;
          if (bytes.length - offset < 4) // maximum byte size for int data type
                                          // is 4
              length = bytes.length - offset;
          else
              length = 4;
  
          int end = offset + length;
          for (int i = 0; i < length; i++) {
              result |= (bytes[end - i - 1] & 0xff) << (8 * i); // TODO uudashr: CHECK FOR IMPROVEMENT
          }
          return result;
      }
docs: 32 bit.
  
  @param bytes
  @param offset
  @return