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

GetChars() private method

private GetChars ( byte bytes, int byteCount, char chars, int charCount ) : int
bytes byte
byteCount int
chars char
charCount int
return int
        public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
        {
            // Validate Parameters
            if (bytes == null || chars == null)
                throw new ArgumentNullException(bytes == null ? nameof(bytes): nameof(chars), SR.ArgumentNull_Array);

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

            return GetChars(bytes, byteCount, chars, charCount, null);
        }

Same methods

EncodingNLS::GetChars ( byte bytes, int byteCount, char chars, int charCount, DecoderNLS decoder ) : int
EncodingNLS::GetChars ( byte bytes, int byteIndex, int byteCount, char chars, int charIndex ) : int

Usage Example

示例#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));
        }
All Usage Examples Of System.Text.EncodingNLS::GetChars