Ejemplo n.º 1
0
        /// <summary>
        /// Update the page data
        /// </summary>
        /// <param name="data">The data buffer to copy from</param>
        /// <param name="srcOffset">The offset in <paramref name="data"/> to start copying from </param>
        /// <param name="pageOffset">The offset in the page to start copying to</param>
        /// <param name="len">The number of bytes to copy</param>
        public void SetData(byte[] data, int srcOffset, int pageOffset, int len)
        {
            lock (_writeLock)
            {
                if (len < 0)
                {
                    len = data.Length;
                }
                Array.ConstrainedCopy(data, srcOffset, _data, pageOffset, len);
                IsDirty = true;
                _modified++;
#if DEBUG_PAGESTORE
                Logging.LogDebug("Update {0} {1} {2}", Id, _modified, BitConverter.ToInt32(_data, 0));
#endif
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Update the page data
        /// </summary>
        /// <param name="data">The data buffer to copy from</param>
        /// <param name="srcOffset">The offset in <paramref name="data"/> to start copying from </param>
        /// <param name="pageOffset">The offset in the page to start copying to</param>
        /// <param name="len">The number of bytes to copy</param>
        public void SetData(byte[] data, int srcOffset, int pageOffset, int len)
        {
            lock (_writeLock)
            {
                if (len < 0)
                {
                    len = data.Length;
                }
                Array.ConstrainedCopy(data, srcOffset, _data, pageOffset, len);
                IsDirty = true;
                _modified++;
#if DEBUG_PAGESTORE
                Logging.LogDebug("Update: PageId={0} Hash={1}", Id, DataHash());
#endif
            }
        }
Ejemplo n.º 3
0
 public void SetData(byte[] data, int srcOffset = 0, int pageOffset = 0, int len = -1)
 {
     _store.EnsureWriteable(_page.Id);
     Array.ConstrainedCopy(data, srcOffset, _data, pageOffset, len < 0 ? data.Length : len);
 }