Class CharsetMBCS.CharsetEncoderMBCS

    • Field Detail

      • allowReplacementChanges

        private boolean allowReplacementChanges
    • Constructor Detail

      • CharsetEncoderMBCS

        CharsetEncoderMBCS​(CharsetICU cs)
    • Method Detail

      • encodeLoop

        protected java.nio.charset.CoderResult encodeLoop​(java.nio.CharBuffer source,
                                                          java.nio.ByteBuffer target,
                                                          java.nio.IntBuffer offsets,
                                                          boolean flush)
        Specified by:
        encodeLoop in class CharsetEncoderICU
      • fromUChar32

        int fromUChar32​(int c,
                        int[] pValue,
                        boolean isUseFallback)
      • continueMatchFromU

        private java.nio.charset.CoderResult continueMatchFromU​(java.nio.CharBuffer source,
                                                                java.nio.ByteBuffer target,
                                                                java.nio.IntBuffer offsets,
                                                                boolean flush,
                                                                int srcIndex)
      • matchFromU

        private int matchFromU​(int firstCP,
                               char[] preArray,
                               int preArrayBegin,
                               int preLength,
                               java.nio.CharBuffer source,
                               int[] pMatchValue,
                               boolean isUseFallback,
                               boolean flush)
        Parameters:
        cx - pointer to extension data; if NULL, returns 0
        firstCP - the first code point before all the other UChars
        pre - UChars that must match; !initialMatch: partial match with them
        preLength - length of pre, >=0
        src - UChars that can be used to complete a match
        srcLength - length of src, >=0
        pMatchValue - [out] output result value for the match from the data structure
        useFallback - "use fallback" flag, usually from cnv->useFallback
        flush - 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

        private java.nio.charset.CoderResult writeFromU​(int value,
                                                        java.nio.ByteBuffer target,
                                                        java.nio.IntBuffer offsets,
                                                        int srcIndex)
      • fromU

        private int fromU​(int cp,
                          java.nio.CharBuffer source,
                          java.nio.ByteBuffer target,
                          java.nio.IntBuffer offsets,
                          int sourceIndex,
                          int length,
                          boolean flush,
                          java.nio.charset.CoderResult[] cr)
      • initialMatchFromU

        private boolean initialMatchFromU​(int cp,
                                          java.nio.CharBuffer source,
                                          java.nio.ByteBuffer target,
                                          java.nio.IntBuffer offsets,
                                          int srcIndex,
                                          boolean flush,
                                          java.nio.charset.CoderResult[] cr)
      • cnvMBCSFromUnicodeWithOffsets

        java.nio.charset.CoderResult cnvMBCSFromUnicodeWithOffsets​(java.nio.CharBuffer source,
                                                                   java.nio.ByteBuffer target,
                                                                   java.nio.IntBuffer offsets,
                                                                   boolean flush)
      • cnvMBCSSingleFromBMPWithOffsets

        private java.nio.charset.CoderResult cnvMBCSSingleFromBMPWithOffsets​(java.nio.CharBuffer source,
                                                                             java.nio.ByteBuffer target,
                                                                             java.nio.IntBuffer offsets,
                                                                             boolean flush)
      • cnvMBCSSingleFromUnicodeWithOffsets

        private java.nio.charset.CoderResult cnvMBCSSingleFromUnicodeWithOffsets​(java.nio.CharBuffer source,
                                                                                 java.nio.ByteBuffer target,
                                                                                 java.nio.IntBuffer offsets,
                                                                                 boolean flush)
      • cnvMBCSDoubleFromUnicodeWithOffsets

        private java.nio.charset.CoderResult cnvMBCSDoubleFromUnicodeWithOffsets​(java.nio.CharBuffer source,
                                                                                 java.nio.ByteBuffer target,
                                                                                 java.nio.IntBuffer offsets,
                                                                                 boolean flush)
      • getTrail

        private final boolean getTrail​(java.nio.CharBuffer source,
                                       java.nio.ByteBuffer target,
                                       int uniMask,
                                       CharsetMBCS.CharsetEncoderMBCS.SideEffects x,
                                       boolean flush,
                                       java.nio.charset.CoderResult[] cr)
      • unassigned

        private final boolean unassigned​(java.nio.CharBuffer source,
                                         java.nio.ByteBuffer target,
                                         java.nio.IntBuffer offsets,
                                         CharsetMBCS.CharsetEncoderMBCS.SideEffects x,
                                         boolean flush,
                                         java.nio.charset.CoderResult[] cr)
      • cbFromUWriteSub

        protected java.nio.charset.CoderResult cbFromUWriteSub​(CharsetEncoderICU encoder,
                                                               java.nio.CharBuffer source,
                                                               java.nio.ByteBuffer target,
                                                               java.nio.IntBuffer offsets)
        Overrides super class method
        Overrides:
        cbFromUWriteSub in class CharsetEncoderICU
        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 class java.nio.charset.CharsetEncoder
        Parameters:
        replacement - The replacement for subchar.