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 class
private final class
private 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 CoderResult
cbFromUWriteSub
(CharsetEncoderICU encoder, CharBuffer source, ByteBuffer target, IntBuffer offsets) Overrides super class methodprivate CoderResult
cnvMBCSDoubleFromUnicodeWithOffsets
(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) (package private) CoderResult
cnvMBCSFromUnicodeWithOffsets
(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) private CoderResult
cnvMBCSSingleFromBMPWithOffsets
(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) private CoderResult
cnvMBCSSingleFromUnicodeWithOffsets
(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) private CoderResult
continueMatchFromU
(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush, int srcIndex) protected CoderResult
encodeLoop
(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) private int
fromU
(int cp, CharBuffer source, ByteBuffer target, IntBuffer offsets, int sourceIndex, int length, boolean flush, CoderResult[] cr) (package private) int
fromUChar32
(int c, int[] pValue, boolean isUseFallback) private final boolean
getTrail
(CharBuffer source, ByteBuffer target, int uniMask, CharsetMBCS.CharsetEncoderMBCS.SideEffects x, boolean flush, CoderResult[] cr) private final boolean
getTrailDouble
(CharBuffer source, ByteBuffer target, int uniMask, CharsetMBCS.CharsetEncoderMBCS.SideEffectsDouble x, boolean flush, CoderResult[] cr) private final boolean
getTrailSingleBMP
(CharBuffer source, CharsetMBCS.CharsetEncoderMBCS.SideEffectsSingleBMP x, CoderResult[] cr) protected void
implReplaceWith
(byte[] replacement) Gets called whenever CharsetEncoder.replaceWith gets called.protected void
Resets the from Unicode mode of converterprivate boolean
initialMatchFromU
(int cp, CharBuffer source, ByteBuffer target, IntBuffer offsets, int srcIndex, boolean flush, CoderResult[] cr) private int
matchFromU
(int firstCP, char[] preArray, int preArrayBegin, int preLength, CharBuffer source, int[] pMatchValue, boolean isUseFallback, boolean flush) private int
simpleMatchFromU
(int cp, int[] pValue, boolean isUseFallback) private final boolean
unassigned
(CharBuffer source, ByteBuffer target, IntBuffer offsets, CharsetMBCS.CharsetEncoderMBCS.SideEffects x, boolean flush, CoderResult[] cr) private final boolean
unassignedDouble
(CharBuffer source, ByteBuffer target, CharsetMBCS.CharsetEncoderMBCS.SideEffectsDouble x, boolean flush, CoderResult[] cr) private CoderResult
writeFromU
(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, setFromUContext
Methods 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:CharsetEncoderICU
Resets the from Unicode mode of converter- Overrides:
implReset
in classCharsetEncoderICU
-
encodeLoop
protected CoderResult encodeLoop(CharBuffer source, ByteBuffer target, IntBuffer offsets, boolean flush) - Specified by:
encodeLoop
in 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:
cx
- pointer to extension data; if NULL, returns 0firstCP
- the first code point before all the other UCharspre
- UChars that must match; !initialMatch: partial match with thempreLength
- length of pre, >=0src
- UChars that can be used to complete a matchsrcLength
- length of src, >=0pMatchValue
- [out] output result value for the match from the data structureuseFallback
- "use fallback" flag, usually from cnv->useFallbackflush
- true if the end of the input stream is reached- 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 <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:
cbFromUWriteSub
in 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:
implReplaceWith
in classCharsetEncoder
- Parameters:
replacement
- The replacement for subchar.
-