public void write(DataOutputStream out) throws IOException, jasError {
  boolean needAnno=false;
  if (visAnnotAttr != null || invisAnnotAttr != null)   needAnno=true;
  for (Iterator i=methods.iterator(); i.hasNext(); ) {
    Method m=(Method)i.next();
    if (m.invis_annot_attr != null || m.vis_annot_attr != null || m.param_invis_annot_attr != null || m.param_vis_annot_attr != null)     needAnno=true;
  }
  for (Iterator i=vars.iterator(); i.hasNext(); ) {
    Var f=(Var)i.next();
    if (f.invis_annot_attr != null || f.vis_annot_attr != null)     needAnno=true;
  }
  if (needAnno)   requireJava1_4();
  out.writeInt(magic);
  out.writeShort(version_lo);
  out.writeShort(version_hi);
  int curidx=1;
  cpe_index=new Hashtable();
  for (Enumeration e=cpe.elements(); e.hasMoreElements(); ) {
    CP tmp=(CP)(e.nextElement());
    cpe_index.put(tmp.getUniq(),new Integer(curidx));
    curidx++;
    if ((tmp instanceof LongCP) || (tmp instanceof DoubleCP))     curidx++;
  }
  out.writeShort((short)curidx);
  for (Enumeration e=cpe.elements(); e.hasMoreElements(); ) {
    CP now=(CP)(e.nextElement());
    now.write(this,out);
  }
  out.writeShort(class_access);
  out.writeShort(getCPIndex(this_class));
  if (hasSuperClass) {
    out.writeShort(getCPIndex(super_class));
  }
 else {
    out.writeShort(0);
  }
  out.writeShort(interfaces.size());
  for (Enumeration e=interfaces.elements(); e.hasMoreElements(); ) {
    CP c=(CP)(e.nextElement());
    out.writeShort(getCPIndex(c));
  }
  out.writeShort(vars.size());
  for (Enumeration e=vars.elements(); e.hasMoreElements(); ) {
    Var v=(Var)(e.nextElement());
    v.write(this,out);
  }
  out.writeShort(methods.size());
  for (Enumeration e=methods.elements(); e.hasMoreElements(); ) {
    Method m=(Method)(e.nextElement());
    m.write(this,out);
  }
  short numExtra=0;
  if (source != null) {
    numExtra=1;
  }
  numExtra+=generic.size();
  if (inner_class_attr != null) {
    numExtra++;
  }
  if (isClassSynth()) {
    numExtra++;
  }
  if (deprAttr != null) {
    numExtra++;
  }
  if (sigAttr != null) {
    numExtra++;
  }
  if (visAnnotAttr != null) {
    numExtra++;
  }
  if (invisAnnotAttr != null) {
    numExtra++;
  }
  if (encl_meth_attr != null) {
    numExtra++;
  }
  if (bsm_attr != null) {
    numExtra++;
  }
  out.writeShort(numExtra);
  if (source != null) {
    source.write(this,out);
  }
  for (Enumeration gen=generic.elements(); gen.hasMoreElements(); ) {
    GenericAttr gattr=(GenericAttr)gen.nextElement();
    gattr.write(this,out);
  }
  if (isClassSynth()) {
    synthAttr.write(this,out);
  }
  if (deprAttr != null) {
    deprAttr.write(this,out);
  }
  if (sigAttr != null) {
    sigAttr.write(this,out);
  }
  if (encl_meth_attr != null) {
    encl_meth_attr.write(this,out);
  }
  if (visAnnotAttr != null) {
    visAnnotAttr.write(this,out);
  }
  if (invisAnnotAttr != null) {
    invisAnnotAttr.write(this,out);
  }
  if (inner_class_attr != null) {
    inner_class_attr.write(this,out);
  }
  if (bsm_attr != null) {
    bsm_attr.write(this,out);
  }
  out.flush();
}

public void write ( DataOutputStream out ) throws IOException , jasError { boolean needAnno = false ; if ( visAnnotAttr != null || invisAnnotAttr != null ) needAnno = true ; for ( Iterator i = methods . iterator ( ) ; i . hasNext ( ) ; ) { Method m = ( Method ) i . next ( ) ; if ( m . invis_annot_attr != null || m . vis_annot_attr != null || m . param_invis_annot_attr != null || m . param_vis_annot_attr != null ) needAnno = true ; } for ( Iterator i = vars . iterator ( ) ; i . hasNext ( ) ; ) { Var f = ( Var ) i . next ( ) ; if ( f . invis_annot_attr != null || f . vis_annot_attr != null ) needAnno = true ; } if ( needAnno ) requireJava1_4 ( ) ; out . writeInt ( magic ) ; out . writeShort ( version_lo ) ; out . writeShort ( version_hi ) ; int curidx = 1 ; cpe_index = new Hashtable ( ) ; for ( Enumeration e = cpe . elements ( ) ; e . hasMoreElements ( ) ; ) { CP tmp = ( CP ) ( e . nextElement ( ) ) ; cpe_index . put ( tmp . getUniq ( ) , new Integer ( curidx ) ) ; curidx ++ ; if ( ( tmp instanceof LongCP ) || ( tmp instanceof DoubleCP ) ) curidx ++ ; } out . writeShort ( ( short ) curidx ) ; for ( Enumeration e = cpe . elements ( ) ; e . hasMoreElements ( ) ; ) { CP now = ( CP ) ( e . nextElement ( ) ) ; now . write ( this , out ) ; } out . writeShort ( class_access ) ; out . writeShort ( getCPIndex ( this_class ) ) ; if ( hasSuperClass ) { out . writeShort ( getCPIndex ( super_class ) ) ; } else { out . writeShort ( 0 ) ; } out . writeShort ( interfaces . size ( ) ) ; for ( Enumeration e = interfaces . elements ( ) ; e . hasMoreElements ( ) ; ) { CP c = ( CP ) ( e . nextElement ( ) ) ; out . writeShort ( getCPIndex ( c ) ) ; } out . writeShort ( vars . size ( ) ) ; for ( Enumeration e = vars . elements ( ) ; e . hasMoreElements ( ) ; ) { Var v = ( Var ) ( e . nextElement ( ) ) ; v . write ( this , out ) ; } out . writeShort ( methods . size ( ) ) ; for ( Enumeration e = methods . elements ( ) ; e . hasMoreElements ( ) ; ) { Method m = ( Method ) ( e . nextElement ( ) ) ; m . write ( this , out ) ; } short numExtra = 0 ; if ( source != null ) { numExtra = 1 ; } numExtra += generic . size ( ) ; if ( inner_class_attr != null ) { numExtra ++ ; } if ( isClassSynth ( ) ) { numExtra ++ ; } if ( deprAttr != null ) { numExtra ++ ; } if ( sigAttr != null ) { numExtra ++ ; } if ( visAnnotAttr != null ) { numExtra ++ ; } if ( invisAnnotAttr != null ) { numExtra ++ ; } if ( encl_meth_attr != null ) { numExtra ++ ; } if ( bsm_attr != null ) { numExtra ++ ; } out . writeShort ( numExtra ) ; if ( source != null ) { source . write ( this , out ) ; } for ( Enumeration gen = generic . elements ( ) ; gen . hasMoreElements ( ) ; ) { GenericAttr gattr = ( GenericAttr ) gen . nextElement ( ) ; gattr . write ( this , out ) ; } if ( isClassSynth ( ) ) { synthAttr . write ( this , out ) ; } if ( deprAttr != null ) { deprAttr . write ( this , out ) ; } if ( sigAttr != null ) { sigAttr . write ( this , out ) ; } if ( encl_meth_attr != null ) { encl_meth_attr . write ( this , out ) ; } if ( visAnnotAttr != null ) { visAnnotAttr . write ( this , out ) ; } if ( invisAnnotAttr != null ) { invisAnnotAttr . write ( this , out ) ; } if ( inner_class_attr != null ) { inner_class_attr . write ( this , out ) ; } if ( bsm_attr != null ) { bsm_attr . write ( this , out ) ; } out . flush ( ) ; }
write the contents of the class .
