Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5 from StaticDefault/master
Browse files Browse the repository at this point in the history
Changed base of class loader default to url.
  • Loading branch information
StaticDefaultTester2 authored Nov 27, 2019
2 parents 1a1cf91 + 1710c45 commit c3d1722
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package com.realtimetech.reflection.classloader;

import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashMap;

import com.realtimetech.reflection.classfile.file.ClassFile;

public class ClassDynamicLoader extends ClassLoader {
public class ClassDynamicLoader extends URLClassLoader {
private HashMap<String, byte[]> classMap;

public ClassDynamicLoader() {
this(null);
}

public ClassDynamicLoader(ClassLoader classLoader) {
super(classLoader);
super(new URL[0], classLoader);
this.classMap = new HashMap<String, byte[]>();
}

public void addURL(URL url) {
super.addURL(url);
}

public void addClass(String className, byte[] bytes) {
this.classMap.put(className, bytes);
}
Expand Down

0 comments on commit c3d1722

Please sign in to comment.