Package com.ibm.icu.charset
Class CharsetMBCS.CharsetDecoderMBCS
- java.lang.Object
-
- java.nio.charset.CharsetDecoder
-
- com.ibm.icu.charset.CharsetDecoderICU
-
- com.ibm.icu.charset.CharsetMBCS.CharsetDecoderMBCS
-
- Enclosing class:
- CharsetMBCS
class CharsetMBCS.CharsetDecoderMBCS extends CharsetDecoderICU
-
-
Field Summary
-
Fields inherited from class com.ibm.icu.charset.CharsetDecoderICU
charErrorBufferArray, charErrorBufferBegin, charErrorBufferLength, EXT_MAX_BYTES, invalidCharBuffer, invalidCharLength, mode, preToUArray, preToUBegin, preToUFirstLength, preToULength, toCharErrorBehaviour, toUBytesArray, toUBytesBegin, toUContext, toULength, toUnicodeStatus
-
-
Constructor Summary
Constructors Constructor Description CharsetDecoderMBCS(CharsetICU cs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.nio.charset.CoderResult
cnvMBCSSingleToBMPWithOffsets(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, boolean flush)
private java.nio.charset.CoderResult
cnvMBCSSingleToUnicodeWithOffsets(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, boolean flush)
(package private) java.nio.charset.CoderResult
cnvMBCSToUnicodeWithOffsets(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, boolean flush)
private java.nio.charset.CoderResult
continueMatchToU(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int srcIndex, boolean flush)
protected java.nio.charset.CoderResult
decodeLoop(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, boolean flush)
private int
getFallback(CharsetMBCS.UConverterMBCSTable mbcsTable, int offset)
private boolean
hasValidTrailBytes(int[][] stateTable, short state)
private boolean
initialMatchToU(int firstLength, java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int srcIndex, boolean flush, java.nio.charset.CoderResult[] cr)
private boolean
isSingleOrLead(int[][] stateTable, int state, boolean isDBCSOnly, int b)
private int
matchToU(byte sisoState, byte[] preArray, int preArrayBegin, int preLength, java.nio.ByteBuffer source, int[] pMatchValue, boolean isUseFallback, boolean flush)
(package private) int
simpleGetNextUChar(java.nio.ByteBuffer source, boolean useFallback)
This is a simple version of _MBCSGetNextUChar() that is used by other converter implementations.private int
simpleMatchToU(java.nio.ByteBuffer source, boolean useFallback)
private int
toU(int length, java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int sourceIndex, boolean flush, java.nio.charset.CoderResult[] cr)
private java.nio.charset.CoderResult
toUWriteCodePoint(int c, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int sourceIndex)
private java.nio.charset.CoderResult
writeToU(int value, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int srcIndex)
-
Methods inherited from class com.ibm.icu.charset.CharsetDecoderICU
decode, decodeLoop, implFlush, implOnMalformedInput, implOnUnmappableCharacter, implReset, isFallbackUsed, isToUUseFallback, isToUUseFallback, maxBytesPerChar, setToUCallback, toUCountPending, toUnicodeWithCallback, toUWriteUChars
-
Methods inherited from class java.nio.charset.CharsetDecoder
averageCharsPerByte, charset, decode, decode, detectedCharset, flush, implReplaceWith, isAutoDetecting, isCharsetDetected, malformedInputAction, maxCharsPerByte, onMalformedInput, onUnmappableCharacter, replacement, replaceWith, reset, unmappableCharacterAction
-
-
-
-
Constructor Detail
-
CharsetDecoderMBCS
CharsetDecoderMBCS(CharsetICU cs)
-
-
Method Detail
-
decodeLoop
protected java.nio.charset.CoderResult decodeLoop(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, boolean flush)
- Specified by:
decodeLoop
in classCharsetDecoderICU
-
continueMatchToU
private java.nio.charset.CoderResult continueMatchToU(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int srcIndex, boolean flush)
-
matchToU
private int matchToU(byte sisoState, byte[] preArray, int preArrayBegin, int preLength, java.nio.ByteBuffer source, int[] pMatchValue, boolean isUseFallback, boolean flush)
-
writeToU
private java.nio.charset.CoderResult writeToU(int value, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int srcIndex)
-
toUWriteCodePoint
private java.nio.charset.CoderResult toUWriteCodePoint(int c, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int sourceIndex)
-
toU
private int toU(int length, java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int sourceIndex, boolean flush, java.nio.charset.CoderResult[] cr)
-
initialMatchToU
private boolean initialMatchToU(int firstLength, java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, int srcIndex, boolean flush, java.nio.charset.CoderResult[] cr)
-
simpleMatchToU
private int simpleMatchToU(java.nio.ByteBuffer source, boolean useFallback)
-
cnvMBCSToUnicodeWithOffsets
java.nio.charset.CoderResult cnvMBCSToUnicodeWithOffsets(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, boolean flush)
-
cnvMBCSSingleToBMPWithOffsets
private java.nio.charset.CoderResult cnvMBCSSingleToBMPWithOffsets(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, boolean flush)
-
cnvMBCSSingleToUnicodeWithOffsets
private java.nio.charset.CoderResult cnvMBCSSingleToUnicodeWithOffsets(java.nio.ByteBuffer source, java.nio.CharBuffer target, java.nio.IntBuffer offsets, boolean flush)
-
getFallback
private int getFallback(CharsetMBCS.UConverterMBCSTable mbcsTable, int offset)
-
simpleGetNextUChar
int simpleGetNextUChar(java.nio.ByteBuffer source, boolean useFallback)
This is a simple version of _MBCSGetNextUChar() that is used by other converter implementations. It only returns an "assigned" result if it consumes the entire input. It does not use state from the converter, nor error codes. It does not handle the EBCDIC swaplfnl option (set in UConverter). It handles conversion extensions but not GB 18030.- Returns:
- U+fffe unassigned U+ffff illegal otherwise the Unicode code point
-
hasValidTrailBytes
private boolean hasValidTrailBytes(int[][] stateTable, short state)
-
isSingleOrLead
private boolean isSingleOrLead(int[][] stateTable, int state, boolean isDBCSOnly, int b)
-
-