# File lib/codec/data.rb, line 176
      def array=(a)
        t = a.type if a.respond_to? :type
        d = a.descriptor if a.respond_to? :descriptor
        if (h = a.instance_variable_get(:@proton_array_header))
          t ||= h.type
          d ||= h.descriptor
        end
        raise TypeError, "no type when converting #{a.class} to an array" unless t
        put_array(!d.nil?, t.code)
        m = Mapping[t]
        enter_exit do
          self << d unless d.nil?
          a.each { |e| m.put(self, e); }
        end
      end