void putMethodInfo(final ByteVector output) {
    boolean useSyntheticAttribute = symbolTable.getMajorVersion() < Opcodes.V1_5;
    int mask = useSyntheticAttribute ? Opcodes.ACC_SYNTHETIC : 0;
    output.putShort(accessFlags & ~mask).putShort(nameIndex).putShort(descriptorIndex);
    // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
    int attributeCount = 0;
    if (code.length > 0) {
      ++attributeCount;
    }
    if (numberOfExceptions > 0) {
      ++attributeCount;
    }
    if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && useSyntheticAttribute) {
      ++attributeCount;
    }
    if (signatureIndex != 0) {
      ++attributeCount;
    }
    if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
      ++attributeCount;
    }
    if (defaultValue != null) {
      ++attributeCount;
    }
    if (parameters != null) {
      ++attributeCount;
    }
    if (firstAttribute != null) {
      attributeCount += firstAttribute.getAttributeCount();
    }
    // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
    output.putShort(attributeCount);
    if (code.length > 0) {
      // 2, 2, 4 and 2 bytes respectively for max_stack, max_locals, code_length and
      // attributes_count, plus the bytecode and the exception table.
      int size = 10 + code.length + Handler.getExceptionTableSize(firstHandler);
      int codeAttributeCount = 0;
      if (stackMapTableEntries != null) {
        // 6 header bytes and 2 bytes for number_of_entries.
        size += 8 + stackMapTableEntries.length;
        ++codeAttributeCount;
      }
      if (lineNumberTable != null) {
        // 6 header bytes and 2 bytes for line_number_table_length.
        size += 8 + lineNumberTable.length;
        ++codeAttributeCount;
      }
      if (localVariableTable != null) {
        // 6 header bytes and 2 bytes for local_variable_table_length.
        size += 8 + localVariableTable.length;
        ++codeAttributeCount;
      }
      if (localVariableTypeTable != null) {
        // 6 header bytes and 2 bytes for local_variable_type_table_length.
        size += 8 + localVariableTypeTable.length;
        ++codeAttributeCount;
      }
      if (firstCodeAttribute != null) {
        size +=
            firstCodeAttribute.computeAttributesSize(
                symbolTable, code.data, code.length, maxStack, maxLocals);
        codeAttributeCount += firstCodeAttribute.getAttributeCount();
      }
      output
          .putShort(symbolTable.addConstantUtf8(Constants.CODE))
          .putInt(size)
          .putShort(maxStack)
          .putShort(maxLocals)
          .putInt(code.length)
          .putByteArray(code.data, 0, code.length);
      Handler.putExceptionTable(firstHandler, output);
      output.putShort(codeAttributeCount);
      if (stackMapTableEntries != null) {
        boolean useStackMapTable = symbolTable.getMajorVersion() >= Opcodes.V1_6;
        output
            .putShort(
                symbolTable.addConstantUtf8(
                    useStackMapTable ? Constants.STACK_MAP_TABLE : "StackMap"))
            .putInt(2 + stackMapTableEntries.length)
            .putShort(stackMapTableNumberOfEntries)
            .putByteArray(stackMapTableEntries.data, 0, stackMapTableEntries.length);
      }
      if (lineNumberTable != null) {
        output
            .putShort(symbolTable.addConstantUtf8(Constants.LINE_NUMBER_TABLE))
            .putInt(2 + lineNumberTable.length)
            .putShort(lineNumberTableLength)
            .putByteArray(lineNumberTable.data, 0, lineNumberTable.length);
      }
      if (localVariableTable != null) {
        output
            .putShort(symbolTable.addConstantUtf8(Constants.LOCAL_VARIABLE_TABLE))
            .putInt(2 + localVariableTable.length)
            .putShort(localVariableTableLength)
            .putByteArray(localVariableTable.data, 0, localVariableTable.length);
      }
      if (localVariableTypeTable != null) {
        output
            .putShort(symbolTable.addConstantUtf8(Constants.LOCAL_VARIABLE_TYPE_TABLE))
            .putInt(2 + localVariableTypeTable.length)
            .putShort(localVariableTypeTableLength)
            .putByteArray(localVariableTypeTable.data, 0, localVariableTypeTable.length);
      }
      if (firstCodeAttribute != null) {
        firstCodeAttribute.putAttributes(
            symbolTable, code.data, code.length, maxStack, maxLocals, output);
      }
    }
    if (numberOfExceptions > 0) {
      output
          .putShort(symbolTable.addConstantUtf8(Constants.EXCEPTIONS))
          .putInt(2 + 2 * numberOfExceptions)
          .putShort(numberOfExceptions);
      for (int exceptionIndex : exceptionIndexTable) {
        output.putShort(exceptionIndex);
      }
    }
    if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && useSyntheticAttribute) {
      output.putShort(symbolTable.addConstantUtf8(Constants.SYNTHETIC)).putInt(0);
    }
    if (signatureIndex != 0) {
      output
          .putShort(symbolTable.addConstantUtf8(Constants.SIGNATURE))
          .putInt(2)
          .putShort(signatureIndex);
    }
    if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
      output.putShort(symbolTable.addConstantUtf8(Constants.DEPRECATED)).putInt(0);
    }
    if (defaultValue != null) {
      output
          .putShort(symbolTable.addConstantUtf8(Constants.ANNOTATION_DEFAULT))
          .putInt(defaultValue.length)
          .putByteArray(defaultValue.data, 0, defaultValue.length);
    }
    if (parameters != null) {
      output
          .putShort(symbolTable.addConstantUtf8(Constants.METHOD_PARAMETERS))
          .putInt(1 + parameters.length)
          .putByte(parametersCount)
          .putByteArray(parameters.data, 0, parameters.length);
    }
    if (firstAttribute != null) {
      firstAttribute.putAttributes(symbolTable, output);
    }
  }
void putMethodInfo ( final ByteVector output ) { boolean useSyntheticAttribute = symbolTable . getMajorVersion ( ) < Opcodes . V1_5 ; int mask = useSyntheticAttribute ? Opcodes . ACC_SYNTHETIC : 0 ; output . putShort ( accessFlags & ~ mask ) . putShort ( nameIndex ) . putShort ( descriptorIndex ) ; int attributeCount = 0 ; if ( code . length > 0 ) { ++ attributeCount ; } if ( numberOfExceptions > 0 ) { ++ attributeCount ; } if ( ( accessFlags & Opcodes . ACC_SYNTHETIC ) != 0 && useSyntheticAttribute ) { ++ attributeCount ; } if ( signatureIndex != 0 ) { ++ attributeCount ; } if ( ( accessFlags & Opcodes . ACC_DEPRECATED ) != 0 ) { ++ attributeCount ; } if ( defaultValue != null ) { ++ attributeCount ; } if ( parameters != null ) { ++ attributeCount ; } if ( firstAttribute != null ) { attributeCount += firstAttribute . getAttributeCount ( ) ; } output . putShort ( attributeCount ) ; if ( code . length > 0 ) { int size = 10 + code . length + Handler . getExceptionTableSize ( firstHandler ) ; int codeAttributeCount = 0 ; if ( stackMapTableEntries != null ) { size += 8 + stackMapTableEntries . length ; ++ codeAttributeCount ; } if ( lineNumberTable != null ) { size += 8 + lineNumberTable . length ; ++ codeAttributeCount ; } if ( localVariableTable != null ) { size += 8 + localVariableTable . length ; ++ codeAttributeCount ; } if ( localVariableTypeTable != null ) { size += 8 + localVariableTypeTable . length ; ++ codeAttributeCount ; } if ( firstCodeAttribute != null ) { size += firstCodeAttribute . computeAttributesSize ( symbolTable , code . data , code . length , maxStack , maxLocals ) ; codeAttributeCount += firstCodeAttribute . getAttributeCount ( ) ; } output . putShort ( symbolTable . addConstantUtf8 ( Constants . CODE ) ) . putInt ( size ) . putShort ( maxStack ) . putShort ( maxLocals ) . putInt ( code . length ) . putByteArray ( code . data , 0 , code . length ) ; Handler . putExceptionTable ( firstHandler , output ) ; output . putShort ( codeAttributeCount ) ; if ( stackMapTableEntries != null ) { boolean useStackMapTable = symbolTable . getMajorVersion ( ) >= Opcodes . V1_6 ; output . putShort ( symbolTable . addConstantUtf8 ( useStackMapTable ? Constants . STACK_MAP_TABLE : "StackMap" ) ) . putInt ( 2 + stackMapTableEntries . length ) . putShort ( stackMapTableNumberOfEntries ) . putByteArray ( stackMapTableEntries . data , 0 , stackMapTableEntries . length ) ; } if ( lineNumberTable != null ) { output . putShort ( symbolTable . addConstantUtf8 ( Constants . LINE_NUMBER_TABLE ) ) . putInt ( 2 + lineNumberTable . length ) . putShort ( lineNumberTableLength ) . putByteArray ( lineNumberTable . data , 0 , lineNumberTable . length ) ; } if ( localVariableTable != null ) { output . putShort ( symbolTable . addConstantUtf8 ( Constants . LOCAL_VARIABLE_TABLE ) ) . putInt ( 2 + localVariableTable . length ) . putShort ( localVariableTableLength ) . putByteArray ( localVariableTable . data , 0 , localVariableTable . length ) ; } if ( localVariableTypeTable != null ) { output . putShort ( symbolTable . addConstantUtf8 ( Constants . LOCAL_VARIABLE_TYPE_TABLE ) ) . putInt ( 2 + localVariableTypeTable . length ) . putShort ( localVariableTypeTableLength ) . putByteArray ( localVariableTypeTable . data , 0 , localVariableTypeTable . length ) ; } if ( firstCodeAttribute != null ) { firstCodeAttribute . putAttributes ( symbolTable , code . data , code . length , maxStack , maxLocals , output ) ; } } if ( numberOfExceptions > 0 ) { output . putShort ( symbolTable . addConstantUtf8 ( Constants . EXCEPTIONS ) ) . putInt ( 2 + 2 * numberOfExceptions ) . putShort ( numberOfExceptions ) ; for ( int exceptionIndex : exceptionIndexTable ) { output . putShort ( exceptionIndex ) ; } } if ( ( accessFlags & Opcodes . ACC_SYNTHETIC ) != 0 && useSyntheticAttribute ) { output . putShort ( symbolTable . addConstantUtf8 ( Constants . SYNTHETIC ) ) . putInt ( 0 ) ; } if ( signatureIndex != 0 ) { output . putShort ( symbolTable . addConstantUtf8 ( Constants . SIGNATURE ) ) . putInt ( 2 ) . putShort ( signatureIndex ) ; } if ( ( accessFlags & Opcodes . ACC_DEPRECATED ) != 0 ) { output . putShort ( symbolTable . addConstantUtf8 ( Constants . DEPRECATED ) ) . putInt ( 0 ) ; } if ( defaultValue != null ) { output . putShort ( symbolTable . addConstantUtf8 ( Constants . ANNOTATION_DEFAULT ) ) . putInt ( defaultValue . length ) . putByteArray ( defaultValue . data , 0 , defaultValue . length ) ; } if ( parameters != null ) { output . putShort ( symbolTable . addConstantUtf8 ( Constants . METHOD_PARAMETERS ) ) . putInt ( 1 + parameters . length ) . putByte ( parametersCount ) . putByteArray ( parameters . data , 0 , parameters . length ) ; } if ( firstAttribute != null ) { firstAttribute . putAttributes ( symbolTable , output ) ; } }
Puts the content of the method_info JVMS structure generated by this MethodWriter into the
given ByteVector.

@param output where the method_info structure must be put.