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

ArrayCopy2() private method

Copies data from source to destination array.
The copy is byte by byte from srcPos to destPos and given length.
private ArrayCopy2 ( byte Src, int SrcPos, byte &Dest, int DestPos, long Length ) : void
Src byte The source array.
SrcPos int The source Position.
Dest byte The destination array.
DestPos int The destination Position.
Length long The length.
return void
        private void ArrayCopy2(byte[] Src, int SrcPos, ref byte[] Dest, int DestPos, long Length)
        {
            if (Dest.Length < DestPos + Length)
            {
                byte[] DestExt = new byte[(int)(DestPos + Length)];
                Array.Copy(Dest, 0, DestExt, 0, Dest.Length);
                Dest = DestExt;
            }

            for (int i = 0; i < Length/* - 1*/; i++)
                Dest[DestPos + i] = Src[SrcPos + i];
        }