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:
java.lang.Comparable<java.nio.charset.Charset>
- Direct Known Subclasses:
CharsetUTF16BE
,CharsetUTF16LE
class CharsetUTF16 extends CharsetICU
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
CharsetUTF16.CharsetDecoderUTF16
(package private) class
CharsetUTF16.CharsetEncoderUTF16
-
Field Summary
Fields Modifier and Type Field Description private byte[]
bom
private static byte[]
BOM_BE
private static byte[]
BOM_LE
private static int
ENDIAN_XOR_BE
private static int
ENDIAN_XOR_LE
private int
endianXOR
private byte[]
fromUSubstitution
private static byte[]
fromUSubstitution_BE
private static byte[]
fromUSubstitution_LE
private boolean
isBigEndian
private boolean
isEndianSpecified
private static int
NEED_TO_WRITE_BOM
private static int
SIGNATURE_LENGTH
private int
version
-
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
Constructors Constructor Description CharsetUTF16(java.lang.String icuCanonicalName, java.lang.String javaCanonicalName, java.lang.String[] aliases)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (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.java.nio.charset.CharsetDecoder
newDecoder()
java.nio.charset.CharsetEncoder
newEncoder()
-
Methods inherited from class com.ibm.icu.charset.CharsetICU
contains, forNameICU, getCharset, getCompleteUnicodeSet, getNonSurrogateUnicodeSet, getUnicodeSet, isFixedWidth, isSurrogate
-
-
-
-
Field Detail
-
SIGNATURE_LENGTH
private static final int SIGNATURE_LENGTH
- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
ENDIAN_XOR_LE
private static final int ENDIAN_XOR_LE
- See Also:
- Constant Field Values
-
NEED_TO_WRITE_BOM
private static final int NEED_TO_WRITE_BOM
- See Also:
- Constant Field Values
-
isEndianSpecified
private boolean isEndianSpecified
-
isBigEndian
private boolean isBigEndian
-
endianXOR
private int endianXOR
-
bom
private byte[] bom
-
fromUSubstitution
private byte[] fromUSubstitution
-
version
private int version
-
-
Method Detail
-
newDecoder
public java.nio.charset.CharsetDecoder newDecoder()
- Specified by:
newDecoder
in classjava.nio.charset.Charset
-
newEncoder
public java.nio.charset.CharsetEncoder newEncoder()
- Specified by:
newEncoder
in classjava.nio.charset.Charset
-
getUnicodeSetImpl
void getUnicodeSetImpl(UnicodeSet setFillIn, int which)
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
-
-