Class ByteUtil


  • public final class ByteUtil
    extends Object
    Class that contains many static methods for byte handling.
    • Method Detail

      • toNumber

        public static long toNumber​(byte[] bytes)
        Get a number from a given array of bytes.
        Parameters:
        bytes - a byte array
        Returns:
        a long
      • toNumber

        public static long toNumber​(byte[] bytes,
                                    int start,
                                    int end)
        Get a number from a given array of bytes.
        Parameters:
        bytes - a byte array
        start - first byte of the array
        end - last byte of the array (exclusive)
        Returns:
        a long
      • toHexadecimal

        public static String toHexadecimal​(byte[] bytes)
        Get a hexadecimal string from given array of bytes.
        Parameters:
        bytes - byte array
        Returns:
        a string