public void write(ByteCodeWriter out) throws IOException {
  out.writeUTF8Const(getName());
  TempOutputStream ts=new TempOutputStream();
  ByteCodeWriter o2=new ByteCodeWriter(ts,out.getJavaClass());
  o2.writeShort(_maxStack);
  o2.writeShort(_maxLocals);
  o2.writeInt(_code.length);
  o2.write(_code,0,_code.length);
  o2.writeShort(_exceptions.size());
  for (int i=0; i < _exceptions.size(); i++) {
    ExceptionItem exn=_exceptions.get(i);
    o2.writeShort(exn.getStart());
    o2.writeShort(exn.getEnd());
    o2.writeShort(exn.getHandler());
    o2.writeShort(exn.getType());
  }
  o2.writeShort(_attributes.size());
  for (int i=0; i < _attributes.size(); i++) {
    Attribute attr=_attributes.get(i);
    attr.write(o2);
  }
  out.writeInt(ts.getLength());
  TempBuffer ptr=ts.getHead();
  for (; ptr != null; ptr=ptr.next())   out.write(ptr.buffer(),0,ptr.length());
  ts.destroy();
}

public void write ( ByteCodeWriter out ) throws IOException { out . writeUTF8Const ( getName ( ) ) ; TempOutputStream ts = new TempOutputStream ( ) ; ByteCodeWriter o2 = new ByteCodeWriter ( ts , out . getJavaClass ( ) ) ; o2 . writeShort ( _maxStack ) ; o2 . writeShort ( _maxLocals ) ; o2 . writeInt ( _code . length ) ; o2 . write ( _code , 0 , _code . length ) ; o2 . writeShort ( _exceptions . size ( ) ) ; for ( int i = 0 ; i < _exceptions . size ( ) ; i ++ ) { ExceptionItem exn = _exceptions . get ( i ) ; o2 . writeShort ( exn . getStart ( ) ) ; o2 . writeShort ( exn . getEnd ( ) ) ; o2 . writeShort ( exn . getHandler ( ) ) ; o2 . writeShort ( exn . getType ( ) ) ; } o2 . writeShort ( _attributes . size ( ) ) ; for ( int i = 0 ; i < _attributes . size ( ) ; i ++ ) { Attribute attr = _attributes . get ( i ) ; attr . write ( o2 ) ; } out . writeInt ( ts . getLength ( ) ) ; TempBuffer ptr = ts . getHead ( ) ; for ( ; ptr != null ; ptr = ptr . next ( ) ) out . write ( ptr . buffer ( ) , 0 , ptr . length ( ) ) ; ts . destroy ( ) ; }
writes the field to the output .
