Class StringByteHelper
- java.lang.Object
-
- com.syntifi.casper.sdk.model.clvalue.encdec.StringByteHelper
-
public final class StringByteHelper extends java.lang.Object
Helper methods for working with hex encoded string and bytes- Since:
- 0.0.1
- See Also:
CLTypeData
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
convertBytesToHex(byte[] bytes)
Helper method which returns byte arrays as hex stringsstatic byte[]
hexStringToByteArray(java.lang.String hexString)
Helper method which converts hex-encodedString
to byte arraystatic void
reverse(byte[] bytes)
Reverses a byte array, used to go from little to big endianess
-
-
-
Method Detail
-
reverse
public static void reverse(byte[] bytes)
Reverses a byte array, used to go from little to big endianess- Parameters:
bytes
- array of bytes to reverse
-
hexStringToByteArray
public static byte[] hexStringToByteArray(java.lang.String hexString) throws InvalidByteStringException
Helper method which converts hex-encodedString
to byte array- Parameters:
hexString
- the hex-encodedString
to decode- Returns:
- decoded array of bytes
- Throws:
InvalidByteStringException
-
convertBytesToHex
public static java.lang.String convertBytesToHex(byte[] bytes)
Helper method which returns byte arrays as hex strings- Parameters:
bytes
- the byte array to encode- Returns:
- hex-encoded value
String
-
-