org.apache.commons.codec.net
public class BCodec extends RFC1522Codec implements StringEncoder, StringDecoder
Identical to the Base64 encoding defined by RFC 1521 and allows a character set to be specified.
RFC 1522 describes techniques to allow the encoding of non-ASCII text in various portions of a RFC 822 [2] message header, in a manner which is unlikely to confuse existing message handling software.
Since: 1.3
Version: $Id: BCodec.java 130357 2004-04-13 22:46:37Z ggregory $
See Also: MIME (Multipurpose Internet Mail Extensions) Part Two: Message
Header Extensions for Non-ASCII Text
Field Summary | |
---|---|
String | charset
The default charset used for string decoding and encoding. |
Constructor Summary | |
---|---|
BCodec()
Default constructor. | |
BCodec(String charset)
Constructor which allows for the selection of a default charset
|
Method Summary | |
---|---|
String | decode(String value)
Decodes a Base64 string into its original form. |
Object | decode(Object value)
Decodes a Base64 object into its original form. |
protected byte[] | doDecoding(byte[] bytes) |
protected byte[] | doEncoding(byte[] bytes) |
String | encode(String value, String charset)
Encodes a string into its Base64 form using the specified charset. |
String | encode(String value)
Encodes a string into its Base64 form using the default charset. |
Object | encode(Object value)
Encodes an object into its Base64 form using the default charset. |
String | getDefaultCharset()
The default charset used for string decoding and encoding.
|
protected String | getEncoding() |
Parameters: charset the default string charset to use.
See Also: JRE character
encoding names
Parameters: value Base64 string to convert into its original form
Returns: original string
Throws: DecoderException A decoder exception is thrown if a failure condition is encountered during the decode process.
Parameters: value Base64 object to convert into its original form
Returns: original object
Throws: DecoderException A decoder exception is thrown if a failure condition is encountered during the decode process.
Parameters: value string to convert to Base64 form charset the charset for pString
Returns: Base64 string
Throws: EncoderException thrown if a failure condition is encountered during the encoding process.
Parameters: value string to convert to Base64 form
Returns: Base64 string
Throws: EncoderException thrown if a failure condition is encountered during the encoding process.
Parameters: value object to convert to Base64 form
Returns: Base64 object
Throws: EncoderException thrown if a failure condition is encountered during the encoding process.
Returns: the default string charset.