GetCharCount() 개인적인 메소드

private GetCharCount ( byte bytes, int count ) : int
bytes byte
count int
리턴 int
예제 #1
0
        public override unsafe int GetCharCount(byte *bytes, int count, bool flush)
        {
            if (bytes is null)
            {
                throw new ArgumentNullException(nameof(bytes));
            }

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

            // Remember the flush
            m_mustFlush       = flush;
            m_throwOnOverflow = true;

            // By default just call the encoding version, no flush by default
            return(m_encoding.GetCharCount(bytes, count, this));
        }
예제 #2
0
        [System.Security.SecurityCritical]  // auto-generated
        public unsafe int GetCharCount(byte *bytes, int count, bool flush)
        {
            // Validate parameters
            if (bytes == null)
            {
                throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array);
            }

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

            // Remember the flush
            m_mustFlush       = flush;
            m_throwOnOverflow = true;

            // By default just call the encoding version, no flush by default
            return(m_encoding.GetCharCount(bytes, count, this));
        }