Package org.forgerock.opendj.ldap
Class Base64
- java.lang.Object
-
- org.forgerock.opendj.ldap.Base64
-
public final class Base64 extends Object
This class provides methods for performing base64 encoding and decoding. Base64 is a mechanism for encoding binary data in ASCII form by converting sets of three bytes with eight significant bits each to sets of four bytes with six significant bits each.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ByteString
decode(String base64)
Decodes the provided base64 encoded data.static String
encode(byte[] bytes)
Encodes the provided data as a base64 string.static String
encode(ByteString bytes)
Encodes the provided data as a base64 string.
-
-
-
Method Detail
-
decode
public static ByteString decode(String base64)
Decodes the provided base64 encoded data.- Parameters:
base64
- The base64 encoded data.- Returns:
- The decoded data.
- Throws:
LocalizedIllegalArgumentException
- If a problem occurs while attempting to decodebase64
.NullPointerException
- Ifbase64
wasnull
.
-
encode
public static String encode(byte[] bytes)
Encodes the provided data as a base64 string.- Parameters:
bytes
- The data to be encoded.- Returns:
- The base64 encoded representation of
bytes
. - Throws:
NullPointerException
- Ifbytes
wasnull
.
-
encode
public static String encode(ByteString bytes)
Encodes the provided data as a base64 string.- Parameters:
bytes
- The data to be encoded.- Returns:
- The base64 encoded representation of
bytes
. - Throws:
NullPointerException
- Ifbytes
wasnull
.
-
-