// loads the original class and adapts it
ClassReader cr = new ClassReader("CommentAttribute");
ClassWriter cw = new ClassWriter(false);
ClassVisitor cv = new AddCommentClassAdapter(cw);
cr.accept(cv, new Attribute[] { new CommentAttribute("") }, false);
byte[] b = cw.toByteArray();
// stores the adapted class on disk
FileOutputStream fos = new FileOutputStream("CommentAttribute.class.new");
fos.write(b);
fos.close();