Package com.itextpdf.xmp.impl
Class Base64
- java.lang.Object
-
- com.itextpdf.xmp.impl.Base64
-
public class Base64 extends java.lang.ObjectA utility class to perform base64 encoding and decoding as specified in RFC-1521. See also RFC 1421.- Version:
- $Revision: 1.4 $
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]asciiprivate static byte[]base64private static byteEQUALmarker for an equal symbolprivate static byteINVALIDmarker for invalid bytesprivate static byteWHITESPACEmarker for accepted whitespace bytes
-
Constructor Summary
Constructors Constructor Description Base64()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]decode(byte[] src)Decode the given byte[].static java.lang.Stringdecode(java.lang.String src)Decode the given string.static byte[]encode(byte[] src)Encode the given byte[].static byte[]encode(byte[] src, int lineFeed)Encode the given byte[].static java.lang.Stringencode(java.lang.String src)Encode the given string.
-
-
-
Field Detail
-
INVALID
private static final byte INVALID
marker for invalid bytes- See Also:
- Constant Field Values
-
WHITESPACE
private static final byte WHITESPACE
marker for accepted whitespace bytes- See Also:
- Constant Field Values
-
EQUAL
private static final byte EQUAL
marker for an equal symbol- See Also:
- Constant Field Values
-
base64
private static byte[] base64
-
ascii
private static byte[] ascii
-
-
Method Detail
-
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 afterlinefeedcharacters; must be dividable by four; 0 means no linefeeds- Returns:
- the base64-encoded data.
-
encode
public static final java.lang.String encode(java.lang.String src)
Encode the given string.- Parameters:
src- the source string.- Returns:
- the base64-encoded string.
-
decode
public static final byte[] decode(byte[] src) throws java.lang.IllegalArgumentExceptionDecode the given byte[].- Parameters:
src- the base64-encoded data.- Returns:
- the decoded data.
- Throws:
java.lang.IllegalArgumentException- Thrown if the base 64 strings contains non-valid characters, beside the bas64 chars, LF, CR, tab and space are accepted.
-
decode
public static final java.lang.String decode(java.lang.String src)
Decode the given string.- Parameters:
src- the base64-encoded string.- Returns:
- the decoded string.
-
-