code: static public int asInt(byte[] array) {
  
          if (null == array || 4 != array.length) {
              throw new IllegalArgumentException("Length of the byte array should be 4");
          }
  
          return ((array[0] << 24)
                  + ((array[1] & 255) << 16)
                  + ((array[2] & 255) << 8) + (array[3] & 255));
      }
docs: Takes an array of 4 bytes and returns an integer that is
  represented by them.
  
  @param array
  @return int that represents the 4 bytes
  @throws IllegalArgumentException for invalid arguments