Package com.ibm.icu.charset
Class CharsetMBCS.CharsetEncoderMBCS
java.lang.Object
java.nio.charset.CharsetEncoder
com.ibm.icu.charset.CharsetEncoderICU
com.ibm.icu.charset.CharsetMBCS.CharsetEncoderMBCS
- Enclosing class:
CharsetMBCS
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classprivate final classprivate final class -
Field Summary
FieldsFields inherited from class com.ibm.icu.charset.CharsetEncoderICU
errorBuffer, errorBufferLength, EXT_MAX_UCHARS, fromCharErrorBehaviour, fromUChar32, fromUContext, fromUnicodeStatus, invalidUCharBuffer, invalidUCharLength, MISSING_CHAR_MARKER, preFromUArray, preFromUBegin, preFromUFirstCP, preFromULength, useFallback, useSubChar1 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CoderResultcbFromUWriteSub(CharsetEncoderICU encoder, CharBuffer source, ByteBuffer target, IntBuffer offsets) Overrides super class methodprivate CoderResultcnvMBCSDoubleFromUnicodeWithOffsets(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) (package private) CoderResultcnvMBCSFromUnicodeWithOffsets(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) private CoderResultcnvMBCSSingleFromBMPWithOffsets(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) private CoderResultcnvMBCSSingleFromUnicodeWithOffsets(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) private CoderResultcontinueMatchFromU(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush, int srcIndex) protected CoderResultencodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) private intfromU(int cp, CharBuffer source, ByteBuffer target, IntBuffer offsets, int sourceIndex, int length, boolean flush, CoderResult[] cr) (package private) intfromUChar32(int c, int[] pValue, boolean isUseFallback) private final booleangetTrail(CharBuffer source, ByteBuffer target, int uniMask, CharsetMBCS.CharsetEncoderMBCS.SideEffects x, boolean flush, CoderResult[] cr) private final booleangetTrailDouble(CharBuffer source, ByteBuffer target, int uniMask, CharsetMBCS.CharsetEncoderMBCS.SideEffectsDouble x, boolean flush, CoderResult[] cr) private final booleangetTrailSingleBMP(CharBuffer source, CharsetMBCS.CharsetEncoderMBCS.SideEffectsSingleBMP x, CoderResult[] cr) protected voidimplReplaceWith(byte[] replacement) Gets called whenever CharsetEncoder.replaceWith gets called.protected voidResets the from Unicode mode of converterprivate booleaninitialMatchFromU(int cp, CharBuffer source, ByteBuffer target, IntBuffer offsets, int srcIndex, boolean flush, CoderResult[] cr) private intmatchFromU(int firstCP, char[] preArray, int preArrayBegin, int preLength, CharBuffer source, int[] pMatchValue, boolean isUseFallback, boolean flush) private intsimpleMatchFromU(int cp, int[] pValue, boolean isUseFallback) private final booleanunassigned(CharBuffer source, ByteBuffer target, IntBuffer offsets, CharsetMBCS.CharsetEncoderMBCS.SideEffects x, boolean flush, CoderResult[] cr) private final booleanunassignedDouble(CharBuffer source, ByteBuffer target, CharsetMBCS.CharsetEncoderMBCS.SideEffectsDouble x, boolean flush, CoderResult[] cr) private CoderResultwriteFromU(int value, ByteBuffer target, IntBuffer offsets, int srcIndex) Methods inherited from class com.ibm.icu.charset.CharsetEncoderICU
cbFromUWriteUChars, encode, encodeLoop, fromUCountPending, fromUnicodeWithCallback, fromUWriteBytes, getMaxBytesForString, handleSurrogates, handleSurrogates, implFlush, implOnMalformedInput, implOnUnmappableCharacter, isFallbackUsed, isFromUUseFallback, isFromUUseFallback, isLegalReplacement, maxCharsPerByte, setFallbackUsed, setFromUCallback, setFromUContextMethods inherited from class java.nio.charset.CharsetEncoder
averageBytesPerChar, canEncode, canEncode, charset, encode, encode, flush, malformedInputAction, maxBytesPerChar, onMalformedInput, onUnmappableCharacter, replacement, replaceWith, reset, unmappableCharacterAction
-
Field Details
-
allowReplacementChanges
private boolean allowReplacementChanges
-
-
Constructor Details
-
CharsetEncoderMBCS
CharsetEncoderMBCS(CharsetICU cs)
-
-
Method Details
-
implReset
protected void implReset()Description copied from class:CharsetEncoderICUResets the from Unicode mode of converter- Overrides:
implResetin classCharsetEncoderICU
-
encodeLoop
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) - Specified by:
encodeLoopin classCharsetEncoderICU
-
fromUChar32
int fromUChar32(int c, int[] pValue, boolean isUseFallback) -
continueMatchFromU
private CoderResult continueMatchFromU(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush, int srcIndex) -
matchFromU
private int matchFromU(int firstCP, char[] preArray, int preArrayBegin, int preLength, CharBuffer source, int[] pMatchValue, boolean isUseFallback, boolean flush) - Parameters:
firstCP- the first code point before all the other UCharspreLength- length of pre, >=0pMatchValue- [out] output result value for the match from the data structureflush- true if the end of the input stream is reachedcx- pointer to extension data; if NULL, returns 0pre- UChars that must match; !initialMatch: partial match with themsrc- UChars that can be used to complete a matchsrcLength- length of src, >=0useFallback- "use fallback" flag, usually from cnv->useFallback- Returns:
- >1: matched, return value=total match length (number of input units matched) 1: matched, no mapping
but request for
(only for the first code point) 0: no match invalid input: '<'0: partial match, return value=negative total match length (partial matches are never returned for flush==true) (partial matches are never returned as being longer than UCNV_EXT_MAX_UCHARS) the matchLength is 2 if only firstCP matched, and >2 if firstCP and further code units matched
-
simpleMatchFromU
private int simpleMatchFromU(int cp, int[] pValue, boolean isUseFallback) -
writeFromU
-
fromU
private int fromU(int cp, CharBuffer source, ByteBuffer target, IntBuffer offsets, int sourceIndex, int length, boolean flush, CoderResult[] cr) -
initialMatchFromU
private boolean initialMatchFromU(int cp, CharBuffer source, ByteBuffer target, IntBuffer offsets, int srcIndex, boolean flush, CoderResult[] cr) -
cnvMBCSFromUnicodeWithOffsets
CoderResult cnvMBCSFromUnicodeWithOffsets(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) -
cnvMBCSSingleFromBMPWithOffsets
private CoderResult cnvMBCSSingleFromBMPWithOffsets(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) -
cnvMBCSSingleFromUnicodeWithOffsets
private CoderResult cnvMBCSSingleFromUnicodeWithOffsets(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) -
cnvMBCSDoubleFromUnicodeWithOffsets
private CoderResult cnvMBCSDoubleFromUnicodeWithOffsets(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) -
getTrailSingleBMP
private final boolean getTrailSingleBMP(CharBuffer source, CharsetMBCS.CharsetEncoderMBCS.SideEffectsSingleBMP x, CoderResult[] cr) -
getTrail
private final boolean getTrail(CharBuffer source, ByteBuffer target, int uniMask, CharsetMBCS.CharsetEncoderMBCS.SideEffects x, boolean flush, CoderResult[] cr) -
unassigned
private final boolean unassigned(CharBuffer source, ByteBuffer target, IntBuffer offsets, CharsetMBCS.CharsetEncoderMBCS.SideEffects x, boolean flush, CoderResult[] cr) -
getTrailDouble
private final boolean getTrailDouble(CharBuffer source, ByteBuffer target, int uniMask, CharsetMBCS.CharsetEncoderMBCS.SideEffectsDouble x, boolean flush, CoderResult[] cr) -
unassignedDouble
private final boolean unassignedDouble(CharBuffer source, ByteBuffer target, CharsetMBCS.CharsetEncoderMBCS.SideEffectsDouble x, boolean flush, CoderResult[] cr) -
cbFromUWriteSub
protected CoderResult cbFromUWriteSub(CharsetEncoderICU encoder, CharBuffer source, ByteBuffer target, IntBuffer offsets) Overrides super class method- Overrides:
cbFromUWriteSubin classCharsetEncoderICU- Parameters:
encoder-source-target-offsets-- Returns:
-
implReplaceWith
protected void implReplaceWith(byte[] replacement) Gets called whenever CharsetEncoder.replaceWith gets called. allowReplacementChanges only allows subChar and subChar1 to be modified outside construction (since replaceWith is called once during construction).- Overrides:
implReplaceWithin classCharsetEncoder- Parameters:
replacement- The replacement for subchar.
-