Class Base64
java.lang.Object
org.apache.ws.security.util.Base64
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Decodes Base64 data into octectsstatic Stringencode(byte[] binaryData) Encode a byte array and fold lines at the standard 76th character.static Stringencode(byte[] binaryData, int length, boolean wrap) Encode a byte array in Base64 format and return an optionally wrapped line.protected static booleanisPad(byte octect) protected static booleanisWhiteSpace(byte octect) static voidprotected static intremoveWhiteSpace(byte[] data) remove WhiteSpace from MIME containing encoded Base64 data.
-
Field Details
-
BASE64DEFAULTLENGTH
public static final int BASE64DEFAULTLENGTHField BASE64DEFAULTLENGTH- See Also:
-
-
Method Details
-
encode
Encode a byte array and fold lines at the standard 76th character.- Parameters:
binaryData-byte[]to be base64 encoded- Returns:
- the
Stringwith encoded data
-
isWhiteSpace
protected static boolean isWhiteSpace(byte octect) -
isPad
protected static boolean isPad(byte octect) -
encode
Encode a byte array in Base64 format and return an optionally wrapped line.- Parameters:
binaryData-byte[]data to be encodedlength-intlength of wrapped lines; No wrapping if less than 4.- Returns:
- a
Stringwith encoded data
-
decode
Decodes Base64 data into octects- Parameters:
encoded- String containing Base64 data- Returns:
- Array containing decoded data.
- Throws:
WSSecurityException
-
removeWhiteSpace
protected static int removeWhiteSpace(byte[] data) remove WhiteSpace from MIME containing encoded Base64 data.- Parameters:
data- the byte array of base64 data (with WS)- Returns:
- the new length
-
main
- Parameters:
args-
-