Package com.ibm.icu.charset
Class CharsetUTF16
java.lang.Object
java.nio.charset.Charset
com.ibm.icu.charset.CharsetICU
com.ibm.icu.charset.CharsetUTF16
- All Implemented Interfaces:
Comparable<Charset>
- Direct Known Subclasses:
CharsetUTF16BE
,CharsetUTF16LE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
private static final byte[]
private static final byte[]
private static final int
private static final int
private int
private byte[]
private static final byte[]
private static final byte[]
private boolean
private boolean
private static final int
private static final int
private int
Fields inherited from class com.ibm.icu.charset.CharsetICU
codepage, conversionType, hasFromUnicodeFallback, hasToUnicodeFallback, icuCanonicalName, maxBytesPerChar, maxCharsPerByte, minBytesPerChar, name, options, platform, ROUNDTRIP_AND_FALLBACK_SET, ROUNDTRIP_SET, subChar, subChar1, subCharLen, unicodeMask
-
Constructor Summary
ConstructorsConstructorDescriptionCharsetUTF16
(String icuCanonicalName, String javaCanonicalName, String[] aliases) -
Method Summary
Modifier and TypeMethodDescription(package private) void
getUnicodeSetImpl
(UnicodeSet setFillIn, int which) This follows ucnv.c method ucnv_detectUnicodeSignature() to detect the start of the stream for example U+FEFF (the Unicode BOM/signature character) that can be ignored.Methods inherited from class com.ibm.icu.charset.CharsetICU
contains, forNameICU, getCharset, getCompleteUnicodeSet, getNonSurrogateUnicodeSet, getUnicodeSet, isFixedWidth, isSurrogate
Methods inherited from class java.nio.charset.Charset
aliases, availableCharsets, canEncode, compareTo, decode, defaultCharset, displayName, displayName, encode, encode, equals, forName, hashCode, isRegistered, isSupported, name, toString
-
Field Details
-
SIGNATURE_LENGTH
private static final int SIGNATURE_LENGTH- See Also:
-
fromUSubstitution_BE
private static final byte[] fromUSubstitution_BE -
fromUSubstitution_LE
private static final byte[] fromUSubstitution_LE -
BOM_BE
private static final byte[] BOM_BE -
BOM_LE
private static final byte[] BOM_LE -
ENDIAN_XOR_BE
private static final int ENDIAN_XOR_BE- See Also:
-
ENDIAN_XOR_LE
private static final int ENDIAN_XOR_LE- See Also:
-
NEED_TO_WRITE_BOM
private static final int NEED_TO_WRITE_BOM- See Also:
-
isEndianSpecified
private boolean isEndianSpecified -
isBigEndian
private boolean isBigEndian -
endianXOR
private int endianXOR -
bom
private byte[] bom -
fromUSubstitution
private byte[] fromUSubstitution -
version
private int version
-
-
Constructor Details
-
CharsetUTF16
-
-
Method Details
-
newDecoder
- Specified by:
newDecoder
in classCharset
-
newEncoder
- Specified by:
newEncoder
in classCharset
-
getUnicodeSetImpl
Description copied from class:CharsetICU
This follows ucnv.c method ucnv_detectUnicodeSignature() to detect the start of the stream for example U+FEFF (the Unicode BOM/signature character) that can be ignored. Detects Unicode signature byte sequences at the start of the byte stream and returns number of bytes of the BOM of the indicated Unicode charset. 0 is returned when no Unicode signature is recognized.- Specified by:
getUnicodeSetImpl
in classCharsetICU
-