System.Net.Security.SslState.CheckOldKeyDecryptedData C# (CSharp) Method

CheckOldKeyDecryptedData() private method

private CheckOldKeyDecryptedData ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
return int
        internal int CheckOldKeyDecryptedData(byte[] buffer, int offset, int count)
        {
            CheckThrow(true);
            if (_queuedReadData != null)
            {
                // This is inefficient yet simple and should be a REALLY rare case.
                int toCopy = Math.Min(_queuedReadCount, count);
                Buffer.BlockCopy(_queuedReadData, 0, buffer, offset, toCopy);
                _queuedReadCount -= toCopy;
                if (_queuedReadCount == 0)
                {
                    _queuedReadData = null;
                }
                else
                {
                    Buffer.BlockCopy(_queuedReadData, toCopy, _queuedReadData, 0, _queuedReadCount);
                }

                return toCopy;
            }
            return -1;
        }
        //