3 Commits
Author SHA1 Message Date
Alex Deymo 4dadd8b443 Pass the size of the new file to the PatchWriterInterface::Init()
Most patch formats include the size of the new file in the header.
To help streaming the patch to disk while generating it, this CL
passes the size of the new file to the patch writer on initialization.

To do this, we also move the Init() call to the patch writer to the
DiffEncoder, which makes more sense since the Close() call is also made
from the DiffEnconder.

Bug: None
Test: Updated tests to check for this value.
Change-Id: Idfaedbd492d68ab6e6cb2c1cb3883947f068c3aa
2017-10-27 13:52:46 +02:00
Alex Deymo 30964e8324 Correct SplitPatchWriter() comment.
Bug: None
Test: Compiles.
Change-Id: I01eded0b094083eb79ccc4c59458e1b88952145d
2017-10-27 13:52:46 +02:00
Alex Deymo e1140a25f4 New SplitPatchWriter to split a bsdiff patch into multiple ones.
This new PatchWriterInterface derived class allows to split the
output patch of a bsdiff run into multiple files of a fixed new file
size. This allows to split long operations with minimal loss of patch
size due to splitting the compression blocks. For large enough new file
sections, this patch size reduction should be minimal.

Bug: 34220646
Test: Added unittests.
Change-Id: Ib90fddd5c55a38c87ce396f2792aa558ecd07b22
2017-10-11 13:08:47 +02:00