Package org.apache.axiom.util.base64
Class Base64Utils
java.lang.Object
org.apache.axiom.util.base64.Base64Utils
- Direct Known Subclasses:
Base64
Contains utility methods to work with base64 encoded data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]decode(char[] data, int off, int len) static voiddecode(char[] data, int off, int len, OutputStream ostream) static byte[]static voiddecode(String data, OutputStream ostream) static Stringencode(byte[] data) Returns base64 representation of specified byte array.static Stringencode(byte[] data, int off, int len) Returns base64 representation of specified byte array.static voidencode(byte[] data, int off, int len, OutputStream ostream) Outputs base64 representation of the specified byte array to a byte stream.static voidOutputs base64 representation of the specified byte array to a character stream.static voidencode(byte[] data, int off, int len, StringBuffer buffer) Outputs base64 representation of the specified byte array to the specified String Bufferstatic Stringencode(DataHandler dh) Get a base64 representation of the content of a givenDataHandleras a string.static char[]Get a base64 representation of the content of a givenDataHandleras a char array.static booleanisValidBase64Encoding(String data) checks input string for invalid Base64 characters
-
Constructor Details
-
Base64Utils
public Base64Utils()
-
-
Method Details
-
encode
Get a base64 representation of the content of a givenDataHandleras a string. This method will try to carry out the encoding operation in the most efficient way.- Parameters:
dh- the data handler with the content to encode- Returns:
- the base64 encoded content
- Throws:
IOException- if an I/O error occurs when reading the content of the data handler
-
encodeToCharArray
Get a base64 representation of the content of a givenDataHandleras a char array. This method will try to carry out the encoding operation in the most efficient way.- Parameters:
dh- the data handler with the content to encode- Returns:
- the base64 encoded content
- Throws:
IOException- if an I/O error occurs when reading the content of the data handler
-
decode
public static byte[] decode(char[] data, int off, int len) -
decode
-
isValidBase64Encoding
checks input string for invalid Base64 characters- Parameters:
data-- Returns:
- true, if String contains only valid Base64 characters. false, otherwise
-
decode
- Throws:
IOException
-
decode
- Throws:
IOException
-
encode
Returns base64 representation of specified byte array. -
encode
Returns base64 representation of specified byte array. -
encode
Outputs base64 representation of the specified byte array to the specified String Buffer -
encode
Outputs base64 representation of the specified byte array to a byte stream.- Throws:
IOException
-
encode
Outputs base64 representation of the specified byte array to a character stream.- Throws:
IOException
-