| java.lang.Object org.springframework.webflow.util.Base64
Base64 | public class Base64 (Code) | | Encodes and decodes to and from Base64 notation.
Based on Base64 encoder and decoder version 2.2.1 written by Robert Harder
(http://iharder.net/base64).
Modified by Erwin Vervaet to use the '.' character as padding character
when using URL safe encoding, like in the Bouncy Castle URLBase64 encoder
(http://www.bouncycastle.org/java.html).
author: Robert Harder author: Erwin Vervaet |
Constructor Summary | |
public | Base64() Create a new Base64 encoder and decoder using the standard Base64 alphabet. | public | Base64(boolean urlSafe) Create a new Base64 encoder and decoder. |
Method Summary | |
final public byte[] | decode(byte[] source, int off, int len) Very low-level access to decoding ASCII characters in
the form of a byte array. | final public byte[] | decode(byte[] source) Decodes data from Base64 notation. | final public byte[] | decodeFromString(String s) Decodes data from Base64 notation. | final public byte[] | encode(byte[] source, int off, int len) Encodes a byte array into Base64 notation. | final public byte[] | encode(byte[] source) Encodes a byte array into Base64 notation. | final public String | encodeToString(byte[] source) Encodes a byte array into Base64 notation. | public boolean | isUrlSafe() Returns whether or not this coder is using Base64-like encoding that is URL- and Filename-safe
as described in Section 4 of RFC3548:
http://www.faqs.org/rfcs/rfc3548.html. |
Base64 | public Base64()(Code) | | Create a new Base64 encoder and decoder using the standard Base64 alphabet.
Note that the resulting encoded strings are not URL-safe: they will
can contain characters that are subject to URL encoding.
|
Base64 | public Base64(boolean urlSafe)(Code) | | Create a new Base64 encoder and decoder.
Allows Base64-like encoding that is URL- and Filename-safe as described
in Section 4 of RFC3548:
http://www.faqs.org/rfcs/rfc3548.html.
When URL-safe encoding is used, the standard "=" Base64 padding character is replaced
with the '.' character.
It is important to note that data encoded this way is not officially valid Base64,
or at the very least should not be called Base64 without also specifying that is
was encoded using the URL- and Filename-safe dialect
Parameters: urlSafe - if true, URL safe encoding and decoding will be used |
decode | final public byte[] decode(byte[] source, int off, int len)(Code) | | Very low-level access to decoding ASCII characters in
the form of a byte array.
Parameters: source - the Base64 encoded data Parameters: off - the offset of where to begin decoding Parameters: len - the length of characters to decode decoded data |
decode | final public byte[] decode(byte[] source)(Code) | | Decodes data from Base64 notation.
Parameters: source - the source data the decoded data |
decodeFromString | final public byte[] decodeFromString(String s)(Code) | | Decodes data from Base64 notation. Uses the platform default
character set to obtain bytes from given string.
Parameters: s - the string to decode the decoded data |
encode | final public byte[] encode(byte[] source, int off, int len)(Code) | | Encodes a byte array into Base64 notation.
Parameters: source - the data to convert Parameters: off - offset in array where conversion should begin Parameters: len - length of data to convert the encoded data |
encode | final public byte[] encode(byte[] source)(Code) | | Encodes a byte array into Base64 notation.
Parameters: source - the data to encode the encoded data |
encodeToString | final public String encodeToString(byte[] source)(Code) | | Encodes a byte array into Base64 notation. The resulting string will
be created using the platform default encoding.
Parameters: source - the source data to encode the encoded data |
isUrlSafe | public boolean isUrlSafe()(Code) | | Returns whether or not this coder is using Base64-like encoding that is URL- and Filename-safe
as described in Section 4 of RFC3548:
http://www.faqs.org/rfcs/rfc3548.html.
When URL-safe encoding is used, the standard "=" Base64 padding character is replaced
with the '.' character.
It is important to note that data encoded this way is not officially valid Base64,
or at the very least should not be called Base64 without also specifying that is
was encoded using the URL- and Filename-safe dialect.
true or false |
|
|