Package org.apache.directory.api.util
Class Base64
- java.lang.Object
-
- org.apache.directory.api.util.Base64
-
public final class Base64 extends Object
Encoding and decoding of Base64 characters to and from raw bytes.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
decode(char[] data)
Decodes a BASE-64 encoded stream to recover the original data.static char[]
encode(byte[] data)
Encodes binary data to a Base64 encoded characters.
-
-
-
Method Detail
-
encode
public static char[] encode(byte[] data)
Encodes binary data to a Base64 encoded characters.- Parameters:
data
- the array of bytes to encode- Returns:
- base64-coded character array.
-
decode
public static byte[] decode(char[] data)
Decodes a BASE-64 encoded stream to recover the original data. White space before and after will be trimmed away, but no other manipulation of the input will be performed. As of version 1.2 this method will properly handle input containing junk characters (newlines and the like) rather than throwing an error. It does this by pre-parsing the input and generating from that a count of VALID input characters.- Parameters:
data
- data to decode.- Returns:
- the decoded binary data.
-
-