public int writeCode(Code code){
  int off=data.position();
  writeUnsignedShort(code.registersSize);
  writeUnsignedShort(code.insSize);
  writeUnsignedShort(code.outsSize);
  writeUnsignedShort(code.tries.length);
  writeInt(code.debugInfoOffset);
  writeInt(code.instructions.length);
  write(code.instructions);
  if (code.tries.length > 0) {
    if ((code.instructions.length & 1) == 1) {
      writeShort((short)0);
    }
    int posBeforeTries=data.position();
    skipWithAutoExpand(code.tries.length * SizeOf.TRY_ITEM);
    int[] offsets=writeCatchHandlers(code.catchHandlers);
    int posAfterCatchHandlers=data.position();
    data.position(posBeforeTries);
    writeTries(code.tries,offsets);
    data.position(posAfterCatchHandlers);
  }
  return off;
}

public int writeCode ( Code code ) { int off = data . position ( ) ; writeUnsignedShort ( code . registersSize ) ; writeUnsignedShort ( code . insSize ) ; writeUnsignedShort ( code . outsSize ) ; writeUnsignedShort ( code . tries . length ) ; writeInt ( code . debugInfoOffset ) ; writeInt ( code . instructions . length ) ; write ( code . instructions ) ; if ( code . tries . length > 0 ) { if ( ( code . instructions . length & 1 ) == 1 ) { writeShort ( ( short ) 0 ) ; } int posBeforeTries = data . position ( ) ; skipWithAutoExpand ( code . tries . length * SizeOf . TRY_ITEM ) ; int [ ] offsets = writeCatchHandlers ( code . catchHandlers ) ; int posAfterCatchHandlers = data . position ( ) ; data . position ( posBeforeTries ) ; writeTries ( code . tries , offsets ) ; data . position ( posAfterCatchHandlers ) ; } return off ; }
write code item into current section .
