File file = new File(new File("/tmp"), className + ".class"); OutputStream out = new BufferedOutputStream(new FileOutputStream(file)); out.write(b); out.close();
if (debugLocation != null) { File file = new File(new File(debugLocation), className + ".class");  OutputStream out = new BufferedOutputStream(new FileOutputStream(file)); out.write(b); out.close(); }
    private static Class defineClass(String className, byte[] b, ClassLoader loader) throws Exception {        // if (debugLocation != null) {        //     File file = new File(new File(debugLocation), className + ".class");        //     // System.err.println("CGLIB writing " + file);        //     OutputStream out = new BufferedOutputStream(new FileOutputStream(file));        //     out.write(bytes);        //     out.close();        // }        File file = new File(new File("/tmp"), className + ".class");        OutputStream out = new BufferedOutputStream(new FileOutputStream(file));        out.write(b);        out.close();                Method m = MethodConstants.DEFINE_CLASS;        boolean flag = m.isAccessible();        m.setAccessible(true);        try {            SecurityManager sm = System.getSecurityManager();            if (className != null && className.startsWith("java.") && sm != null) {                sm.checkPermission(DEFINE_CGLIB_CLASS_IN_JAVA_PACKAGE_PERMISSION);            }            // deprecated method in jdk to define classes, used because it            // does not throws SecurityException if class name starts with "java."            Object[] args = new Object[]{ b, new Integer(0), new Integer(b.length) };            return (Class)m.invoke(loader, args);        } finally {            m.setAccessible(flag);        }    }