Reduce PatchWriterInterface functionality.
The recently introduced PatchWriterInterface had both the patch file format logic and the diff/extra streams selection from the control entries. While this simplifies the bsdiff main algorithm and makes invalid usages of the BsdiffPatchWriter evident, writing alternative PatchWriterInterface classes required to replicate the diff/extra stream selection logic. This patch splits out the diff/extra stream generation and all the checks around those to a new helper class DiffEncoder. The public interface PatchWriterInterface now has two methods to accept the diff and extra stream data, and does not compute them. Bug: 34220646 Test: Added unittests. Ran bsdiff on some pairs of files obtaining the same result as before. Change-Id: I5f303c06f1e10910eb00dcfda38c6811977a91cf
Loading
Please sign in to comment