/** * Writes the ClassFile to the given OutputStream. */ public void writeTo(OutputStream out) throws IOException { if (!(out instanceof DataOutput)) { out = new DataOutputStream(out); } writeTo((DataOutput)out); }
/** * Define the new class from a ClassFile object. * * @return the newly created class * @throws IllegalStateException if new class has already been defined * or if a stream has already been opened */ public Class defineClass(ClassFile cf) { try { cf.writeTo(openStream()); } catch (IOException e) { throw new InternalError(e.toString()); } return getNewClass(); }
/** * Writes the ClassFile to the given OutputStream. */ public void writeTo(OutputStream out) throws IOException { if (!(out instanceof DataOutput)) { out = new DataOutputStream(out); } writeTo((DataOutput)out); }
/** * Define the new class from a ClassFile object. * * @return the newly created class * @throws IllegalStateException if new class has already been defined * or if a stream has already been opened */ public Class defineClass(ClassFile cf) { try { cf.writeTo(openStream()); } catch (IOException e) { throw new InternalError(e.toString()); } return getNewClass(); }