System.Text.DecoderNLS.Convert C# (CSharp) Method

Convert() private method

private Convert ( byte bytes, int byteCount, char chars, int charCount, bool flush, int &bytesUsed, int &charsUsed, bool &completed ) : void
bytes byte
byteCount int
chars char
charCount int
flush bool
bytesUsed int
charsUsed int
completed bool
return void
        public unsafe override void Convert(byte* bytes, int byteCount,
                                              char* chars, int charCount, bool flush,
                                              out int bytesUsed, out int charsUsed, out bool completed)
        {
            // Validate input 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();

            // We don't want to throw
            m_mustFlush = flush;
            m_throwOnOverflow = false;
            m_bytesUsed = 0;

            // Do conversion
            charsUsed = m_encoding.GetChars(bytes, byteCount, chars, charCount, this);
            bytesUsed = m_bytesUsed;

            // It's completed if they've used what they wanted AND if they didn't want flush or if we are flushed
            completed = (bytesUsed == byteCount) && (!flush || !HasState) &&
                               (m_fallbackBuffer == null || m_fallbackBuffer.Remaining == 0);
            // Our data thingies are now full, we can return
        }

Same methods

DecoderNLS::Convert ( byte bytes, int byteIndex, int byteCount, char chars, int charIndex, int charCount, bool flush, int &bytesUsed, int &charsUsed, bool &completed ) : void