System.Text.EncodingNLS.GetByteCount C# (CSharp) Method

GetByteCount() private method

private GetByteCount ( char chars, int count ) : int
chars char
count int
return int
        public unsafe override int GetByteCount(char* chars, int count)
        {
            // Validate Parameters
            if (chars == null)
                throw new ArgumentNullException(nameof(chars), SR.ArgumentNull_Array);

            if (count < 0)
                throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
            Contract.EndContractBlock();

            // Call it with empty encoder
            return GetByteCount(chars, count, null);
        }

Same methods

EncodingNLS::GetByteCount ( String s ) : int
EncodingNLS::GetByteCount ( char chars, int count, EncoderNLS encoder ) : int
EncodingNLS::GetByteCount ( char chars, int index, int count ) : int

Usage Example

示例#1
0
        public override unsafe int GetByteCount(char *chars, int count, bool flush)
        {
            if (chars is null)
            {
                throw new ArgumentNullException(nameof(chars));
            }

            if (count < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
            }

            m_mustFlush       = flush;
            m_throwOnOverflow = true;
            return(m_encoding.GetByteCount(chars, count, this));
        }
All Usage Examples Of System.Text.EncodingNLS::GetByteCount