Package org.ka2ddo.util
Class Base64
java.lang.Object
org.ka2ddo.util.Base64
Base64 conversion methods, for use with older versions of Java that don't expose this to users.
JRE didn't make it available until Java 8.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Convert a Base-64 String into an array of bytes.static String
byteArrayToBase64
(byte[] a) Convert a byte array into a Base64 string.
-
Method Details
-
byteArrayToBase64
Convert a byte array into a Base64 string. The string is line-wrapped so no line exceeds 72 characters in length.- Parameters:
a
- byte array to convert- Returns:
- Base64-encoded String
-
base64ToByteArray
Convert a Base-64 String into an array of bytes.- Parameters:
s
- Base-64 string (line wraps removed)- Returns:
- byte array of decoded data
-