Class HexUtils

java.lang.Object
host.anzo.commons.utils.HexUtils

public class HexUtils extends Object
  • Constructor Details

    • HexUtils

      public HexUtils()
  • Method Details

    • stringToHexByteArray

      public static byte @NotNull [] stringToHexByteArray(@NotNull @NotNull String string)
      Converts a string of space-separated hexadecimal values into a byte array.
      Parameters:
      string - the string containing space-separated hexadecimal values
      Returns:
      the byte array converted from the string
    • stringToHexString

      @NotNull public static @NotNull String stringToHexString(@NotNull @NotNull String string)
      Converts a string to a hexadecimal string representation.
      Parameters:
      string - the string to convert
      Returns:
      the hexadecimal string representation of the input string
    • byteArrayToHex

      @NotNull public static @NotNull String byteArrayToHex(byte @NotNull [] bytes)
      Converts a byte array to a hexadecimal string representation.
      Parameters:
      bytes - the byte array to convert
      Returns:
      the hexadecimal string representation of the byte array
    • hexStringToByteArray

      public static byte @NotNull [] hexStringToByteArray(@NotNull @NotNull String str)
      Converts a hexadecimal string to a byte array.
      Parameters:
      str - the hexadecimal string to convert
      Returns:
      the byte array converted from the string
    • byteArrayToHexTable

      @NotNull public static @NotNull String byteArrayToHexTable(byte[] data, int size)
      Converts a byte array to a formatted hexadecimal table string.
      Parameters:
      data - the byte array containing the data to be converted
      size - the number of bytes to convert
      Returns:
      the formatted hexadecimal table string
    • byteArrayToHexTable

      @NotNull public static @NotNull String byteArrayToHexTable(@NotNull @NotNull ByteBuffer data, int size)
      Converts a byte array to a formatted hexadecimal table string.
      Parameters:
      data - the byte buffer containing the data to be converted
      size - the number of bytes to convert
      Returns:
      the formatted hexadecimal table string
    • byteArrayToHexTable

      @NotNull public static @NotNull String byteArrayToHexTable(byte[] data)
      Converts a byte array to a formatted hexadecimal table string.
      Parameters:
      data - the byte array to convert
      Returns:
      the formatted hexadecimal table string