public class UTF7Charset
extends java.nio.charset.Charset
Modifier and Type | Class and Description |
---|---|
protected class |
UTF7Charset.Decoder
The Decoder inner class handles the decoding of the UTF7 charset.
|
protected class |
UTF7Charset.Encoder
The Encoder inner class handles the encoding of the UTF7 charset.
|
Constructor and Description |
---|
UTF7Charset()
Constructs an instance of the UTF7Charset.
|
UTF7Charset(java.lang.String canonicalName,
java.lang.String[] aliases,
boolean optionalDirect)
Constructs an instance of the UTF7Charset, specifying whether the
O-set characters are to be encoded directly or using a shift sequence.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canEncode()
Tells whether or not this charset supports encoding.
|
boolean |
contains(java.nio.charset.Charset cs)
Tells whether or not this charset contains the given charset.
|
java.nio.charset.CharsetDecoder |
newDecoder()
Constructs a new decoder for this charset.
|
java.nio.charset.CharsetEncoder |
newEncoder()
Constructs a new encoder for this charset.
|
public UTF7Charset()
public UTF7Charset(java.lang.String canonicalName, java.lang.String[] aliases, boolean optionalDirect)
canonicalName
- The canonical name of this charsetaliases
- An array of this charset's aliases, or null if it has no aliasesoptionalDirect
- if true, O-set characters are encoded directly,
otherwise they are encoded using a shift sequence.java.nio.charset.IllegalCharsetNameException
- If the canonical name or any of the aliases are illegalpublic boolean contains(java.nio.charset.Charset cs)
A charset C is said to contain a charset D if, and only if, every character representable in D is also representable in C. If this relationship holds then it is guaranteed that every string that can be encoded in D can also be encoded in C without performing any replacements.
That C contains D does not imply that each character representable in C by a particular byte sequence is represented in D by the same byte sequence, although sometimes this is the case.
Every charset contains itself.
This method computes an approximation of the containment relation: If it returns true then the given charset is known to be contained by this charset; if it returns false, however, then it is not necessarily the case that the given charset is not contained in this charset.
contains
in class java.nio.charset.Charset
public boolean canEncode()
canEncode
in class java.nio.charset.Charset
public java.nio.charset.CharsetDecoder newDecoder()
newDecoder
in class java.nio.charset.Charset
public java.nio.charset.CharsetEncoder newEncoder()
newEncoder
in class java.nio.charset.Charset
java.lang.UnsupportedOperationException
- If this charset does not support encoding