Ampere's law for a loop with zero enclosed current [duplicate]

This question already has an answer here:

Imagine a wire with current I flowing through it. If we take a closed loop that doesnt contain the I the line integral will be zero. Does this means magnetic field is zero ? Also does Ampere law calculating the total magnetic field or only the sum of magnetic fields from the currents that are enclosed in the loop?

marked as duplicate by Aaron Stevens, ZeroTheHero, John Rennie electromagnetism StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Feb 10 at 7:03

of course not. Unless you can argue that the magnetic field is constant over the loop so that $$\oint \vec B\cdot d\vec \ell= \vert\vec B \vert \oint d\ell$$ you cannot deduce anything about $$\vec B$$.
In the same way if a Gaussian surface encloses no charge it does not mean the field is 0 unless the magnitude of $$\vec E$$ is constant over the surface.