void Struct_Method::writeStruct(DataWriter &data) const
{
    if (!exceptionHandlers.isEmpty())
    {
        data.putAddress(exceptionHandlerTable, "exceptionHandlerTable");
        data.put16(offsetHandlers, "offsetHandlers");
        data.put16(lengthHandlers, "lengthHandlers");
    }
    else
    {
        data.putAddress(0, "exceptionHandlerTable");
        data.put16(0, "offsetHandlers");
        data.put16(0, "lengthHandlers");
    }

    if (!exceptions.isEmpty())
    {
        data.putAddress(exceptionsTable, "exceptionsTable");
        data.put16(offsetExceptions, "offsetExceptions");
        data.put16(lengthExceptions, "lengthExceptions");
    }
    else
    {
        data.putAddress(0, "exceptionsTable");
        data.put16(0, "offsetExceptions");
        data.put16(0, "lengthExceptions");
    }

    data.put16(accessFlags, "accessFlags");
    data.put16(nameIndex, "nameIndex");
    data.put16(descriptorIndex, "descriptorIndex");
    data.put16(maxStacks, "maxStacks");
    data.put16(maxLocals, "maxLocals");

    if (nativeFunction != NULL)
    {
        data.put16(nativeFunction->id, "nativeFunctionId");
    }
    else
    {
        data.put16(code.length(), "codeLength");
        data.putBytes(code, "code");
    }

    data.put8(parameterTypes.length(), "parameterTypesLength");
    data.putBytes(parameterTypes, "parameterTypes");
}