diff options
Diffstat (limited to 'vpp-common/vpp-translate-utils/src/main/java')
-rw-r--r-- | vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java index 4ecf8ff91..0902064eb 100644 --- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java +++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java @@ -109,8 +109,12 @@ public final class TranslateUtils { * @return byte array with address bytes */ public static byte[] ipv4AddressNoZoneToArray(final Ipv4AddressNoZone ipv4Addr) { + return ipv4AddressNoZoneToArray(ipv4Addr.getValue()); + } + + public static byte[] ipv4AddressNoZoneToArray(final String ipv4Addr) { byte[] retval = new byte[4]; - String[] dots = ipv4Addr.getValue().split("\\."); + String[] dots = ipv4Addr.split("\\."); for (int d = 0; d < 4; d++) { retval[d] = (byte) (Short.parseShort(dots[d]) & 0xff); |