GetChars() private method

private GetChars ( byte bytes, int byteCount, char chars, int charCount ) : int
bytes byte
byteCount int
chars char
charCount int
return int
Ejemplo n.º 1
0
        public override unsafe int GetChars(byte *bytes, int byteCount,
                                            char *chars, int charCount, bool flush)
        {
            if (bytes is null)
            {
                throw new ArgumentNullException(nameof(bytes));
            }

            if (chars is null)
            {
                throw new ArgumentNullException(nameof(chars));
            }

            if (byteCount < 0 || charCount < 0)
            {
                throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
            }

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

            // By default just call the encoding's version
            return(m_encoding.GetChars(bytes, byteCount, chars, charCount, this));
        }
Ejemplo n.º 2
0
        [System.Security.SecurityCritical]  // auto-generated
        public override unsafe int GetChars(byte *bytes, int byteCount,
                                            char *chars, int charCount, bool flush)
        {
            // Validate parameters
            if (chars == null || bytes == null)
            {
                throw new ArgumentNullException((chars == null ? nameof(chars): nameof(bytes)), SR.ArgumentNull_Array);
            }

            if (byteCount < 0 || charCount < 0)
            {
                throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount): nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
            }
            Contract.EndContractBlock();

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

            // By default just call the encoding's version
            return(m_encoding.GetChars(bytes, byteCount, chars, charCount, this));
        }