Files.FAR3.Decompresser.OffsetCopy C# (CSharp) Method

OffsetCopy() private method

Copies data from array at destPos-srcPos to array at destPos.
private OffsetCopy ( byte &array, int srcPos, int destPos, long length ) : void
array byte The array.
srcPos int The Position to copy from (reverse from end of array!)
destPos int The Position to copy to.
length long The length of data to copy.
return void
        private void OffsetCopy(ref byte[] array, int srcPos, int destPos, long length)
        {
            srcPos = destPos - srcPos;

            if (array.Length < destPos + length)
            {
                byte[] NewArray = new byte[(int)(destPos + length)];
                Array.Copy(array, 0, NewArray, 0, array.Length);
                array = NewArray;
            }

            for (int i = 0; i < length /*- 1*/; i++)
            {
                array[destPos + i] = array[srcPos + i];
            }
        }