code: public void write(OutputStream os)
      throws IOException
    {
      ByteCodeWriter out = new ByteCodeWriter(os, this);
  
      out.writeInt(MAGIC);
      out.writeShort(_minor);
      out.writeShort(_major);
  
      _constantPool.write(out);
  
      out.writeShort(_accessFlags);
      out.writeClass(_thisClass);
      out.writeClass(_superClass);
  
      out.writeShort(_interfaces.size());
      for (int i = 0; i < _interfaces.size(); i++) {
        String className = _interfaces.get(i);
  
        out.writeClass(className);
      }
  
      out.writeShort(_fields.size());
      for (int i = 0; i < _fields.size(); i++) {
        JavaField field = _fields.get(i);
  
        field.write(out);
      }
  
      out.writeShort(_methods.size());
      for (int i = 0; i < _methods.size(); i++) {
        JavaMethod method = _methods.get(i);
  
        method.write(out);
      }
  
      out.writeShort(_attributes.size());
      for (int i = 0; i < _attributes.size(); i++) {
        Attribute attr = _attributes.get(i);
  
        attr.write(out);
      }
    }
docs: Writes the class to the output.