diff options
Diffstat (limited to 'vpp-common')
-rw-r--r-- | vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java index 3424af534..c7583fb52 100644 --- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java +++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/ByteDataTranslator.java @@ -16,6 +16,7 @@ package io.fd.hc2vpp.common.translate.util; +import java.util.Arrays; import java.util.Objects; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -58,6 +59,13 @@ public interface ByteDataTranslator { } /** + * Checks if provided array contains only zeros + */ + default boolean isArrayZeroed(final byte[] arr) { + return Arrays.equals(arr, new byte[arr.length]); + } + + /** * Returns Boolean.TRUE if argument is 0, Boolean.FALSE otherwise. * * @param value byte value to be converted |