@Override
    public InputStream getResourceAsStream(String name) {
        JavaFileObject jfo = getFileObject(name);
        if (jfo != null) {
            byte[] bytes = ((MemJavaFileObject) jfo).getByteArray();
            return new ByteArrayInputStream(bytes);
        } else {
            return null;
        }
    }
MemClassLoader is a mmemory based implementation of the ClassLoader interface

@author tiwe
querydsl-codegen-utils/src/main/java/com/querydsl/codegen/utils/MemClassLoader.java