3 Commits
Author SHA1 Message Date
Tianjie Xu 18480eb706 Implement a simple logger for bsdiff
The logger supports LOG & PLOG. It also adds a std::endl at the end of
the stream so that we don't need to add it manually at the callsite.

Test: run bsdiff and check the logs.
Change-Id: Ice94902a501532ceaeb480c3576e752e435cab70
2017-11-30 12:28:06 -08:00
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 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