GetByteCount() private method

private GetByteCount ( String s ) : int
s String
return int
Esempio n. 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));
        }
Esempio n. 2
0
        [System.Security.SecurityCritical]  // auto-generated
        public unsafe int GetByteCount(char *chars, int count, bool flush)
        {
            // Validate input parameters
            if (chars == null)
            {
                throw new ArgumentNullException("chars", SR.ArgumentNull_Array);
            }

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

            m_mustFlush       = flush;
            m_throwOnOverflow = true;
            return(m_encoding.GetByteCount(chars, count, this));
        }