Package com.nexmo.client.sms
Class HexUtil
- java.lang.Object
-
- com.nexmo.client.sms.HexUtil
-
public class HexUtil extends java.lang.Object
Static helper methods for working with hex values.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringbytesToHex(byte[] bytes)translate a byte array of raw data into a String with a hex representation of that datastatic java.lang.StringbytesToHex(byte[] bytes, java.lang.String separator)translate a byte array of raw data into a String with a hex representation of that data.static byte[]hexToBytes(java.lang.String str)Converts a Hex encoded String into a byte vector.
-
-
-
Method Detail
-
bytesToHex
public static java.lang.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 java.lang.String bytesToHex(byte[] bytes, java.lang.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 dataseparator- 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(java.lang.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.
-
-