System.Text.DecoderFallbackBuffer.InternalInitialize C# (CSharp) Method

InternalInitialize() private method

private InternalInitialize ( byte byteStart, char charEnd ) : void
byteStart byte
charEnd char
return void
        internal unsafe void InternalInitialize(byte* byteStart, char* charEnd)
        {
            this.byteStart = byteStart;
            this.charEnd = charEnd;
        }

Usage Example

示例#1
0
        internal override unsafe int GetCharCount(byte *bytes, int count, DecoderNLS decoder)
        {
            DecoderReplacementFallback replacementFallback = decoder != null ? decoder.Fallback as DecoderReplacementFallback : this.DecoderFallback as DecoderReplacementFallback;

            if (replacementFallback != null && replacementFallback.MaxCharCount == 1)
            {
                return(count);
            }
            DecoderFallbackBuffer decoderFallbackBuffer = (DecoderFallbackBuffer)null;
            int num1 = count;

            byte[] bytes1 = new byte[1];
            byte * numPtr = bytes + count;

            while (bytes < numPtr)
            {
                byte num2 = *bytes;
                ++bytes;
                if ((int)num2 >= 128)
                {
                    if (decoderFallbackBuffer == null)
                    {
                        decoderFallbackBuffer = decoder != null ? decoder.FallbackBuffer : this.DecoderFallback.CreateFallbackBuffer();
                        decoderFallbackBuffer.InternalInitialize(numPtr - count, (char *)null);
                    }
                    bytes1[0] = num2;
                    num1      = num1 - 1 + decoderFallbackBuffer.InternalFallback(bytes1, bytes);
                }
            }
            return(num1);
        }
All Usage Examples Of System.Text.DecoderFallbackBuffer::InternalInitialize