System.Data.SqlClient.SqlCachedBuffer.AddByteOrderMark C# (CSharp) Method

AddByteOrderMark() private static method

private static AddByteOrderMark ( byte byteArr, List cachedBytes ) : void
byteArr byte
cachedBytes List
return void
        private static void AddByteOrderMark(byte[] byteArr, List<byte[]> cachedBytes)
        {
            // Need to find out if we should add byte order mark or not. 
            // We need to add this if we are getting ntext xml, not if we are getting binary xml
            // Binary Xml always begins with the bytes 0xDF and 0xFF
            // If we aren't getting these, then we are getting Unicode xml
            if ((byteArr.Length < 2) || (byteArr[0] != 0xDF) || (byteArr[1] != 0xFF))
            {
                Debug.Assert(cachedBytes.Count == 0);
                cachedBytes.Add(TdsEnums.XMLUNICODEBOMBYTES);
            }
        }