System.Xml.Ucs4Decoder3412.GetFullChars C# (CSharp) Méthode

GetFullChars() private méthode

private GetFullChars ( byte bytes, int byteIndex, int byteCount, char chars, int charIndex ) : int
bytes byte
byteIndex int
byteCount int
chars char
charIndex int
Résultat int
        internal override int GetFullChars( byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex ) {
            uint code;
            int i,j;
            
            byteCount += byteIndex;

            for ( i = byteIndex, j = charIndex; i+3 < byteCount; ) {
                code = (uint)( ( bytes[i+2] << 24 ) | ( bytes[i+3] << 16 ) | ( bytes[i] << 8 ) | bytes[i+1] );
                if ( code > 0x10FFFF ) {
                    throw new ArgumentException( Res.GetString( Res.Enc_InvalidByteInEncoding, new object[1] { i } ), (string)null );
                }
                else if ( code > 0xFFFF ) {
                    chars[j] = UnicodeToUTF16( code );
                    j++;
                }
                else {
                    if ( code >= 0xD800 && code <= 0xDFFF ) {
                        throw new XmlException( Res.Xml_InvalidCharInThisEncoding, string.Empty );
                    }
                    else {
                        chars[j] = (char)code;
                    }
                }
                j++;
                i += 4;
            }
            return j - charIndex;
        }
    }
Ucs4Decoder3412