Sure, that's one line and then you're done. And only if you care about very old (WinXP) or deliberately obnoxious (OpenBSD) platforms.
Re:AWS IPv4 Estate Now Worth $4.5B
by GoblinSlayer on Monday September 18, 2023 @12:21PM
(#37558304)
WinXP implements sockaddr_storage from RFC 2553 - a sufficiently large generic socket address.
If you're unlucky you'll also have to sacrifice a goat to appease the JVM gods. JVM behaviours vary hugely across implementation, version and underlying platform. Not to mention the short sighted decision made by many sysadmins to disable IPv6 completely...