/// <summary> /// Generates a delta stream /// </summary> /// <param name="signature">The signature for the stream</param> /// <param name="filename">The (possibly) altered stream to create the delta for</param> /// <param name="output">The delta output</param> public static void GenerateDelta(Stream signature, Stream input, Stream output) { SharpRSync.ChecksumFileReader cs = new XervBackup.Library.SharpRSync.ChecksumFileReader(signature); SharpRSync.DeltaFile df = new XervBackup.Library.SharpRSync.DeltaFile(cs); df.GenerateDeltaFile(input, output); }
/// <summary> /// Constructs a stream from a basestream and a delta stream /// </summary> /// <param name="basefile">The most recent full copy of the file</param> /// <param name="deltafile">The delta file</param> /// <param name="outputfile">The restored file</param> public static void PatchFile(Stream basestream, Stream delta, Stream output) { SharpRSync.DeltaFile df = new XervBackup.Library.SharpRSync.DeltaFile(delta); df.PatchFile(basestream, output); }