System.Text.DecoderNLS.GetCharCount C# (CSharp) Метод

GetCharCount() приватный Метод

private GetCharCount ( byte bytes, int index, int count, bool flush ) : int
bytes byte
index int
count int
flush bool
Результат int
        public unsafe override int GetCharCount(byte[] bytes, int index, int count, bool flush)
        {
            // Validate Parameters
            if (bytes == null)
                throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array);

            if (index < 0 || count < 0)
                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index): nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);

            if (bytes.Length - index < count)
                throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);

            Contract.EndContractBlock();

            // Avoid null fixed problem
            if (bytes.Length == 0)
                bytes = new byte[1];

            // Just call pointer version
            fixed (byte* pBytes = bytes)
                return GetCharCount(pBytes + index, count, flush);
        }

Same methods

DecoderNLS::GetCharCount ( byte bytes, int count, bool flush ) : int
DecoderNLS::GetCharCount ( byte bytes, int index, int count ) : int