Package org.firebirdsql.util
Class ByteArrayHelper
java.lang.Object
org.firebirdsql.util.ByteArrayHelper
Helper methods for byte arrays.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]fromBase64String(String base64) Decodes a base64 encoded string to a byte array.static byte[]fromHexString(String hexString) Converts the provided hexadecimal string to a byte array.static StringtoHexString(byte[] bytes) Converts the provided byte array to a hexadecimal string
-
Method Details
-
toHexString
Converts the provided byte array to a hexadecimal stringAdapted from http://stackoverflow.com/a/21429909/466862 by higginse
- Parameters:
bytes- byte array (notnull- Returns:
- String with the content of the byte array in hexadecimal.
-
fromHexString
Converts the provided hexadecimal string to a byte array.- Parameters:
hexString- Hexadecimal string- Returns:
- byte array
- Since:
- 4.0
-
fromBase64String
Decodes a base64 encoded string to a byte array.- Parameters:
base64- Base64 encoded data- Returns:
- byte array after decoding
-