CrystalMpq.MpqFileStream.ApplyCopyPatch C# (CSharp) Method

ApplyCopyPatch() private method

private ApplyCopyPatch ( PatchInfoHeader &patchInfoHeader, PatchHeader &patchHeader, uint patchLength, byte originalData ) : byte[]
patchInfoHeader PatchInfoHeader
patchHeader PatchHeader
patchLength uint
originalData byte
return byte[]
        private byte[] ApplyCopyPatch(ref PatchInfoHeader patchInfoHeader, ref PatchHeader patchHeader, uint patchLength, byte[] originalData)
        {
            if (patchLength != patchHeader.PatchedFileSize) throw new InvalidDataException("CopyPatchInvalidSize");

            var patchedData = patchLength == originalData.Length ? originalData : new byte[patchLength];

            if (Read(patchedData, 0, patchedData.Length) != patchedData.Length) throw new EndOfStreamException();

            return patchedData;
        }