Package com.itextpdf.kernel.xmp.impl
Class Base64
java.lang.Object
com.itextpdf.kernel.xmp.impl.Base64
A utility class to perform base64 encoding and decoding as specified in RFC-1521. See also RFC 1421.
- Version:
- $Revision: 1.4 $
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final byte[]
decode
(byte[] src) Decode the given byte[].static final String
Decode the given string.static final byte[]
encode
(byte[] src) Encode the given byte[].static final byte[]
encode
(byte[] src, int lineFeed) Encode the given byte[].static final String
Encode the given string.
-
Constructor Details
-
Base64
public Base64()
-
-
Method Details
-
encode
public static final byte[] encode(byte[] src) Encode the given byte[].- Parameters:
-
src
- the source string. - Returns:
- the base64-encoded data.
-
encode
public static final byte[] encode(byte[] src, int lineFeed) Encode the given byte[].- Parameters:
-
src
- the source string. -
lineFeed
- a linefeed is added afterlinefeed
characters; must be dividable by four; 0 means no linefeeds - Returns:
- the base64-encoded data.
-
encode
Encode the given string.- Parameters:
-
src
- the source string. - Returns:
- the base64-encoded string.
-
decode
Decode the given byte[].- Parameters:
-
src
- the base64-encoded data. - Returns:
- the decoded data.
- Throws:
-
IllegalArgumentException
- Thrown if the base 64 strings contains non-valid characters, beside the bas64 chars, LF, CR, tab and space are accepted.
-
decode
Decode the given string.- Parameters:
-
src
- the base64-encoded string. - Returns:
- the decoded string.
-