Acts of piracy cannot be committed by a warship if the crew has not mutinied. It is literally not possible; piracy is defined by UNCLOS (article 101) as
(a) any illegal acts of violence or detention, or any act of depredation, committed for private ends by the crew or the passengers of a private ship or a private aircraft, and directed:
(i) on the high seas, against another ship or aircraft, or against persons or property on board such ship or aircraft;
(ii) against a ship, aircraft, persons or property in a place outside the jurisdiction of any State;
The only time piracy applies to warships is if the crew has mutinied (UNCLOS article 102) (if a crew hasn't mutinied but are attacking vessels for private ends, that's a matter for diplomats and internal discipline; warships are immune from any jurisdiction but their own). Official action by a navy isn't piracy; it's pretty much the exact opposite of it.
That means the applicable law is the law of blockades. It is well-established customary international law that belligerents may blockade their enemies, and that the blockade applies to neutral shipping containing military goods. Whether it applies to neutrals carrying non-military goods is not quite settled; however, the fact that the neutrals are neutrals doesn't stop a blockading power from boarding them to ensure they're not carrying contraband.
There has been historical debate over blockades applying in international waters. However, actual practice, generally accepted, is that if a neutral ship is carrying contraband to a belligerent, it can be stopped in international waters. This is one of the tradeoffs a neutral power makes -- it needs to actually be neutral, and one part of neutrality is accepting that your ships are subject to blockades by one belligerent if carrying things to another.
Now, an illegal blockade may be an act of war. That still doesn't mean Sweden and Israel are in a state of war. Acts of war do not instantly trigger a war; wars only happen when the countries actually decide to enter wars. All an act of war can do is give the victim a valid reason to declare war; it does not actually force them to declare it.