System.Xml.Ucs4Decoder4321.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+3] << 24 ) | ( bytes[i+2] << 16 ) | ( bytes[i+1] << 8 ) | bytes[i] );
                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;
        }
    };
Ucs4Decoder4321