code: public long convertIPBytes(byte[] ipBytes) {
          if (ipBytes.length == 4) {
              long ipLong = (((long)ipBytes[0]) << 24);
              ipLong |= (((long)ipBytes[1]) << 16);
              ipLong |= (((long)ipBytes[2]) << 8);
              ipLong |= (long)ipBytes[3];
              return ipLong;
          }
          return -1;
      }
docs: converts an array of four bytes to a long.
  @return the converted bytes as a lon or -1 on error.