Package com.vonage.client.sms
Class HexUtil
java.lang.Object
com.vonage.client.sms.HexUtil
Static helper methods for working with hex values.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
bytesToHex
(byte[] bytes) translate a byte array of raw data into a String with a hex representation of that datastatic String
bytesToHex
(byte[] bytes, String separator) translate a byte array of raw data into a String with a hex representation of that data.static byte[]
hexToBytes
(String str) Converts a Hex encoded String into a byte vector.
-
Method Details
-
bytesToHex
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
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
Converts a Hex encoded String into a byte vector.- Parameters:
str
- The String to be encoded.- Returns:
- A byte vector representing the String.
-