GSF.IO.BlockAllocatedMemoryStream.InitializeToPosition C# (CSharp) Method

InitializeToPosition() private method

Initializes all of the bytes to zero.
private InitializeToPosition ( long position ) : void
position long
return void
        private void InitializeToPosition(long position)
        {
            long bytesToClear = position - m_length;

            while (bytesToClear > 0)
            {
                int bytesToClearInBlock = (int)Math.Min(bytesToClear, BlockSize - (m_length & BlockMask));
                Array.Clear(m_blocks[(int)(m_length >> ShiftBits)], (int)(m_length & BlockMask), bytesToClearInBlock);
                m_length += bytesToClearInBlock;
                bytesToClear = position - m_length;
            }
        }