Package sop.util
Class HexUtil
- java.lang.Object
-
- sop.util.HexUtil
-
-
Constructor Summary
Constructors Constructor Description HexUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
bytesToHex(byte[] bytes)
Encode a byte array to a hex string.static byte[]
hexToBytes(String s)
Decode a hex string into a byte array.
-
-
-
Constructor Detail
-
HexUtil
public HexUtil()
-
-
Method Detail
-
bytesToHex
public static String bytesToHex(byte[] bytes)
Encode a byte array to a hex string.- Parameters:
bytes
- bytes- Returns:
- hex encoding
- See Also:
- How to convert a byte array to a hex string in Java?
-
hexToBytes
public static byte[] hexToBytes(String s)
Decode a hex string into a byte array.- Parameters:
s
- hex string- Returns:
- decoded byte array
- See Also:
- Convert a string representation of a hex dump to a byte array using Java?
-
-