UTF7StyleCharsetpublic abstract class UTF7StyleCharset extends Charset
Abstract base class for UTF-7 style encoding and decoding.
|
Fields Summary |
---|
private static final List | CONTAINED | final boolean | strict | Base64Util | base64 |
Constructors Summary |
---|
protected UTF7StyleCharset(String canonicalName, String[] aliases, String alphabet, boolean strict)
Besides the name and aliases, two additional parameters are required.
First the base 64 alphabet used; in modified UTF-7 a slightly different
alphabet is used. Additionally, it should be specified if encoders and
decoders should be strict about the interpretation of malformed encoded
sequences. This is used since modified UTF-7 specifically disallows some
constructs which are allowed (or not specifically disallowed) in UTF-7
(RFC 2152).
super(canonicalName, aliases);
this.base64 = new Base64Util(alphabet);
this.strict = strict;
|
Methods Summary |
---|
abstract boolean | canEncodeDirectly(char ch)Tells if a character can be encoded using simple (US-ASCII) encoding or
requires base 64 encoding.
| public boolean | contains(java.nio.charset.Charset cs)
return CONTAINED.contains(cs.name());
| public java.nio.charset.CharsetDecoder | newDecoder()
return new UTF7StyleCharsetDecoder(this, base64, strict);
| public java.nio.charset.CharsetEncoder | newEncoder()
return new UTF7StyleCharsetEncoder(this, base64, strict);
| abstract byte | shift()Returns character used to switch to base 64 encoding.
| abstract byte | unshift()Returns character used to switch from base 64 encoding to simple
encoding.
|
|