public class RFC1522QCodec 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 conditionally thread-safe. The instance field m_bEncodeBlanks
is mutable setEncodeBlanks(boolean) but is not volatile, and
accesses are not synchronised. If an instance of the class is shared between
threads, the caller needs to ensure that suitable synchronisation is used to
ensure safe publication of the value between threads, and must not invoke
setEncodeBlanks(boolean) after initial setup.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_ENCODE_BLANKS |
POSTFIX, PREFIX, SEP| Constructor and Description |
|---|
RFC1522QCodec()
Default constructor with the UTF-8 charset.
|
RFC1522QCodec(Charset aCharset)
Constructor which allows for the selection of a default charset.
|
| Modifier and Type | Method and Description |
|---|---|
static BitSet |
getAllPrintableChars() |
protected byte[] |
getDecoded(byte[] aEncodedBuffer,
int nOfs,
int nLen) |
protected byte[] |
getEncoded(byte[] aDecodedBuffer,
int nOfs,
int nLen) |
protected String |
getRFC1522Encoding()
Returns the codec name (referred to as encoding in the RFC 1522).
|
boolean |
isEncodeBlanks()
Tests if optional transformation of SPACE characters is to be used
|
void |
setEncodeBlanks(boolean bEncodeBlanks)
Defines whether optional transformation of SPACE characters is to be used
|
getCharset, getDecoded, getEncodedpublic static final boolean DEFAULT_ENCODE_BLANKS
@Nonnull @ReturnsMutableCopy public static BitSet getAllPrintableChars()
protected String getRFC1522Encoding()
AbstractRFC1522CodecgetRFC1522Encoding in class AbstractRFC1522Codecpublic boolean isEncodeBlanks()
true if SPACE characters are to be transformed,
false otherwisepublic void setEncodeBlanks(boolean bEncodeBlanks)
bEncodeBlanks - true if SPACE characters are to be transformed,
false otherwise@Nullable @ReturnsMutableCopy protected byte[] getEncoded(@Nullable byte[] aDecodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen)
getEncoded in class AbstractRFC1522Codec@Nullable @ReturnsMutableCopy protected byte[] getDecoded(@Nullable byte[] aEncodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen)
getDecoded in class AbstractRFC1522CodecCopyright © 2014–2020 Philip Helger. All rights reserved.