public Class<?> loadClass(String url, String name) throws ClassNotFoundException {
     try {
       URL myUrl = new URL(url);
       URLConnection connection = myUrl.openConnection();
       InputStream input = connection.getInputStream();
       ByteArrayOutputStream buffer = new ByteArrayOutputStream();
       int data = input.read();
 
       while (data != -1) {
         buffer.write(data);
         data = input.read();
       }
 
       input.close();
 
       byte[] classData = buffer.toByteArray();
 
       return defineClass(null, classData, 0, classData.length);
     }
     catch (MalformedURLException e) {
       e.printStackTrace();
     } catch (IOException e) {
       e.printStackTrace();
     }
 
     return null;
   }