// TODO: inner classes will not be found (need to replace . with $) static InputStream inputStreamForClass(Class c) ctex { if (c == null) null; ClassLoader cl = getClassLoader(c); if (cl cast InMemoryClassLoader) { byte[] bytes = cl.getClassBytes(c); if (bytes != null) ret byteArrayInputStream(bytes); } // handle JavaXClassLoader Cl files = cast getOpt(cl, 'files); if (files != null) { S name = c.getName().replace('.', '/') + ".class"; for (File location : files) try object InputStream in = inputStreamForFileInDirOrZip(location, name); fail(name + " not found in: " + files); } ifdef Jython // for patched Jython class loader if (classNameIs(cl, "org.python.core.BytecodeLoader$Loader")) { Map rawData = cast getOpt(cl, "rawData"); ret byteArrayInputStreamOrNull(mapGet(rawData, c.getName())); } endifdef ret null; }