public class RFC1522BCodec extends AbstractRFC1522Codec
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.
This class is immutable and thread-safe.
POSTFIX, PREFIX, SEP| Constructor and Description |
|---|
RFC1522BCodec()
Default constructor with the UTF-8 charset.
|
RFC1522BCodec(Charset aCharset)
Constructor which allows for the selection of a default charset
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decode(byte[] aEncodedBuffer)
Decode a byte array.
|
String |
decodeText(String sText)
Decodes a Base64 string into its original form.
|
byte[] |
encode(byte[] aDecodedBuffer)
Encode a byte array.
|
String |
encodeText(String sText)
Encodes a string into its Base64 form using the default charset.
|
Charset |
getCharset()
Gets the default charset name used for string decoding and encoding.
|
protected String |
getRFC1522Encoding()
Returns the codec name (referred to as encoding in the RFC 1522).
|
encodeTextdecode, encodeprotected String getRFC1522Encoding()
AbstractRFC1522CodecgetRFC1522Encoding in class AbstractRFC1522Codec@Nonnull public Charset getCharset()
IStringCodecnull.@Nullable public byte[] encode(@Nullable byte[] aDecodedBuffer)
IByteArrayEncoderaDecodedBuffer - The byte array to be encoded. May be null.null if the parameter was
null.@Nullable public byte[] decode(@Nullable byte[] aEncodedBuffer)
IByteArrayDecoderaEncodedBuffer - The byte array to be decoded. May not be null.null if the parameter was
null.@Nullable public String encodeText(@Nullable String sText) throws EncoderException
sText - string to convert to Base64 formEncoderException - thrown if a failure condition is encountered during the encoding
process.@Nullable public String decodeText(@Nullable String sText) throws DecoderException
decodeText in interface IStringCodecdecodeText in class AbstractRFC1522CodecsText - Base64 string to convert into its original formDecoderException - A decoder exception is thrown if a failure condition is encountered
during the decode process.Copyright © 2006–2015 phloc systems. All rights reserved.