|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.util.Base64
public class Base64
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).
Constructor Summary | |
---|---|
Base64()
Create a new Base64 encoder and decoder using the standard Base64 alphabet. |
|
Base64(boolean urlSafe)
Create a new Base64 encoder and decoder. |
Method Summary | |
---|---|
byte[] |
decode(byte[] source)
Decodes data from Base64 notation. |
byte[] |
decode(byte[] source,
int off,
int len)
Very low-level access to decoding ASCII characters in the form of a byte array. |
byte[] |
decodeFromString(java.lang.String s)
Decodes data from Base64 notation. |
byte[] |
encode(byte[] source)
Encodes a byte array into Base64 notation. |
byte[] |
encode(byte[] source,
int off,
int len)
Encodes a byte array into Base64 notation. |
java.lang.String |
encodeToString(byte[] source)
Encodes a byte array into Base64 notation. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Base64()
public Base64(boolean urlSafe)
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
urlSafe
- if true, URL safe encoding and decoding will be usedMethod Detail |
---|
public boolean isUrlSafe()
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.
public final byte[] encode(byte[] source, int off, int len)
source
- the data to convertoff
- offset in array where conversion should beginlen
- length of data to convert
public final byte[] encode(byte[] source)
source
- the data to encode
public final java.lang.String encodeToString(byte[] source)
source
- the source data to encode
public final byte[] decode(byte[] source, int off, int len)
source
- the Base64 encoded dataoff
- the offset of where to begin decodinglen
- the length of characters to decode
public final byte[] decode(byte[] source)
source
- the source data
public final byte[] decodeFromString(java.lang.String s)
s
- the string to decode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |