Methods Summary |
---|
public java.lang.Object | decode(java.lang.Object value)Decodes a Base64 object into its original form. Escaped characters are converted back to their original
representation.
if (value == null) {
return null;
} else if (value instanceof String) {
return decode((String) value);
} else {
throw new DecoderException("Objects of type "
+ value.getClass().getName()
+ " cannot be decoded using BCodec");
}
|
public java.lang.String | decode(java.lang.String value)Decodes a Base64 string into its original form. Escaped characters are converted back to their original
representation.
if (value == null) {
return null;
}
try {
return decodeText(value);
} catch (UnsupportedEncodingException e) {
throw new DecoderException(e.getMessage());
}
|
protected byte[] | doDecoding(byte[] bytes)
if (bytes == null) {
return null;
}
return Base64.decodeBase64(bytes);
|
protected byte[] | doEncoding(byte[] bytes)
if (bytes == null) {
return null;
}
return Base64.encodeBase64(bytes);
|
public java.lang.String | encode(java.lang.String value, java.lang.String charset)Encodes a string into its Base64 form using the specified charset. Unsafe characters are escaped.
if (value == null) {
return null;
}
try {
return encodeText(value, charset);
} catch (UnsupportedEncodingException e) {
throw new EncoderException(e.getMessage());
}
|
public java.lang.String | encode(java.lang.String value)Encodes a string into its Base64 form using the default charset. Unsafe characters are escaped.
if (value == null) {
return null;
}
return encode(value, getDefaultCharset());
|
public java.lang.Object | encode(java.lang.Object value)Encodes an object into its Base64 form using the default charset. Unsafe characters are escaped.
if (value == null) {
return null;
} else if (value instanceof String) {
return encode((String) value);
} else {
throw new EncoderException("Objects of type "
+ value.getClass().getName()
+ " cannot be encoded using BCodec");
}
|
public java.lang.String | getDefaultCharset()The default charset used for string decoding and encoding.
return this.charset;
|
protected java.lang.String | getEncoding()
return "B";
|