Package com.ibm.icu.charset
Class CharsetBOCU1
java.lang.Object
java.nio.charset.Charset
com.ibm.icu.charset.CharsetICU
com.ibm.icu.charset.CharsetBOCU1
- All Implemented Interfaces:
Comparable<Charset>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int[]
private static final int[]
protected byte[]
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
ConstructorsConstructorDescriptionCharsetBOCU1
(String icuCanonicalName, String javaCanonicalName, String[] aliases) -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
BOCU1_LENGTH_FROM_PACKED
(int packed) private static int
BOCU1_PREV
(int c) Fast version of bocu1Prev() for most scripts.private static int
BOCU1_SIMPLE_PREV
(int c) private static int
BOCU1_TRAIL_TO_BYTE
(int trail) private static int
bocu1Prev
(int c) Compute the next "previous" value for differencing from the current code point.private static boolean
DIFF_IS_DOUBLE
(int diff) Is a diff value encodable in two bytes?private static boolean
DIFF_IS_SINGLE
(int diff) Is a diff value encodable in a single byte?(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.private static int
PACK_SINGLE_DIFF
(int diff) Encode a diff value in a single byte.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, forName, hashCode, isRegistered, isSupported, name, toString
-
Field Details
-
BOCU1_ASCII_PREV
private static final byte BOCU1_ASCII_PREV- See Also:
-
BOCU1_MIN
private static final int BOCU1_MIN- See Also:
-
BOCU1_MIDDLE
private static final int BOCU1_MIDDLE- See Also:
-
BOCU1_MAX_TRAIL
private static final int BOCU1_MAX_TRAIL- See Also:
-
BOCU1_RESET
private static final int BOCU1_RESET- See Also:
-
BOCU1_TRAIL_CONTROLS_COUNT
private static final int BOCU1_TRAIL_CONTROLS_COUNT- See Also:
-
BOCU1_TRAIL_BYTE_OFFSET
private static final int BOCU1_TRAIL_BYTE_OFFSET- See Also:
-
BOCU1_TRAIL_COUNT
private static final int BOCU1_TRAIL_COUNT- See Also:
-
BOCU1_SINGLE
private static final int BOCU1_SINGLE- See Also:
-
BOCU1_LEAD_2
private static final int BOCU1_LEAD_2- See Also:
-
BOCU1_LEAD_3
private static final int BOCU1_LEAD_3- See Also:
-
BOCU1_REACH_POS_1
private static final int BOCU1_REACH_POS_1- See Also:
-
BOCU1_REACH_NEG_1
private static final int BOCU1_REACH_NEG_1- See Also:
-
BOCU1_REACH_POS_2
private static final int BOCU1_REACH_POS_2- See Also:
-
BOCU1_REACH_NEG_2
private static final int BOCU1_REACH_NEG_2- See Also:
-
BOCU1_REACH_POS_3
private static final int BOCU1_REACH_POS_3- See Also:
-
BOCU1_REACH_NEG_3
private static final int BOCU1_REACH_NEG_3- See Also:
-
BOCU1_START_POS_2
private static final int BOCU1_START_POS_2- See Also:
-
BOCU1_START_POS_3
private static final int BOCU1_START_POS_3- See Also:
-
BOCU1_START_POS_4
private static final int BOCU1_START_POS_4- See Also:
-
BOCU1_START_NEG_2
private static final int BOCU1_START_NEG_2- See Also:
-
BOCU1_START_NEG_3
private static final int BOCU1_START_NEG_3- See Also:
-
bocu1ByteToTrail
private static final int[] bocu1ByteToTrail -
bocu1TrailToByte
private static final int[] bocu1TrailToByte -
fromUSubstitution
protected byte[] fromUSubstitution
-
-
Constructor Details
-
CharsetBOCU1
-
-
Method Details
-
BOCU1_LENGTH_FROM_PACKED
private static int BOCU1_LENGTH_FROM_PACKED(int packed) -
BOCU1_TRAIL_TO_BYTE
private static int BOCU1_TRAIL_TO_BYTE(int trail) -
BOCU1_SIMPLE_PREV
private static int BOCU1_SIMPLE_PREV(int c) -
bocu1Prev
private static int bocu1Prev(int c) Compute the next "previous" value for differencing from the current code point.- Parameters:
c
- current code point, 0x3040..0xd7a3 (rest handled by macro below)- Returns:
- "previous code point" state value
-
BOCU1_PREV
private static int BOCU1_PREV(int c) Fast version of bocu1Prev() for most scripts. -
DIFF_IS_SINGLE
private static boolean DIFF_IS_SINGLE(int diff) Is a diff value encodable in a single byte? -
PACK_SINGLE_DIFF
private static int PACK_SINGLE_DIFF(int diff) Encode a diff value in a single byte. -
DIFF_IS_DOUBLE
private static boolean DIFF_IS_DOUBLE(int diff) Is a diff value encodable in two bytes? -
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
-