Package org.forgerock.opendj.ldap
Class Base64
java.lang.Object
org.forgerock.opendj.ldap.Base64
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
Modifier and TypeMethodDescriptionstatic ByteStringDecodes the provided base64 encoded data.static Stringencode(byte[] bytes) Encodes the provided data as a base64 string.static Stringencode(ByteString bytes) Encodes the provided data as a base64 string.
-
Method Details
-
decode
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- Ifbase64wasnull.
-
encode
Encodes the provided data as a base64 string.- Parameters:
bytes- The data to be encoded.- Returns:
- The base64 encoded representation of
bytes. - Throws:
NullPointerException- Ifbyteswasnull.
-
encode
Encodes the provided data as a base64 string.- Parameters:
bytes- The data to be encoded.- Returns:
- The base64 encoded representation of
bytes. - Throws:
NullPointerException- Ifbyteswasnull.
-