GetBytes() private method

private GetBytes ( String s, int charIndex, int charCount, byte bytes, int byteIndex ) : int
s String
charIndex int
charCount int
bytes byte
byteIndex int
return int
Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
        [System.Security.SecurityCritical]  // auto-generated
        public 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 ? "chars" : "bytes"), SR.ArgumentNull_Array);
            }

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

            m_mustFlush       = flush;
            m_throwOnOverflow = true;
            return(m_encoding.GetBytes(chars, charCount, bytes, byteCount, this));
        }