Class HexUtil

java.lang.Object
com.vonage.client.sms.HexUtil

public class HexUtil extends Object
Static helper methods for working with hex values.
  • Method Details

    • bytesToHex

      public static String bytesToHex(byte[] bytes)
      translate a byte array of raw data into a String with a hex representation of that data
      Parameters:
      bytes - raw binary data
      Returns:
      String Hex representation of the raw data
    • bytesToHex

      public static String bytesToHex(byte[] bytes, String separator)
      translate a byte array of raw data into a String with a hex representation of that data. Each octet will be separated with a specific separator.
      Parameters:
      bytes - raw binary data
      separator - This string will be injected into the output in between each octet in the stream
      Returns:
      String Hex representation of the raw data with each octet separated by 'separator'
    • hexToBytes

      public static byte[] hexToBytes(String str)
      Converts a Hex encoded String into a byte vector.
      Parameters:
      str - The String to be encoded.
      Returns:
      A byte vector representing the String.