System.Text.EncodingNLS.GetBytes C# (CSharp) Метод

GetBytes() приватный Метод

private GetBytes ( char chars, int charCount, byte bytes, int byteCount ) : int
chars char
charCount int
bytes byte
byteCount int
Результат int
        public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount)
        {
            // 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 GetBytes(chars, charCount, bytes, byteCount, null);
        }

Same methods

EncodingNLS::GetBytes ( String s, int charIndex, int charCount, byte bytes, int byteIndex ) : int
EncodingNLS::GetBytes ( char chars, int charCount, byte bytes, int byteCount, EncoderNLS encoder ) : int
EncodingNLS::GetBytes ( char chars, int charIndex, int charCount, byte bytes, int byteIndex ) : int

Usage Example

Пример #1
0
        public override unsafe int GetBytes(char *chars, int charCount, byte *bytes, int byteCount, 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);
            }

            m_mustFlush       = flush;
            m_throwOnOverflow = true;
            return(m_encoding.GetBytes(chars, charCount, bytes, byteCount, this));
        }
All Usage Examples Of System.Text.EncodingNLS::GetBytes