summaryrefslogtreecommitdiff
path: root/bz2_compressor.h
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2017-11-14 22:46:38 -0800
committerTianjie Xu <xunchang@google.com>2017-11-16 14:46:37 -0800
commitb4cba64184d6cc745749b325430d838ff0b42bd7 (patch)
treeb896c876897c97fc5ebbbede814294d18c7146a9 /bz2_compressor.h
parent4d10c3efd7b74145e2d1c68e3a178c0fbedbd2a2 (diff)
downloadbsdiff-b4cba64184d6cc745749b325430d838ff0b42bd7.tar.gz
Implement a new bsdiff format
Add a new BSDF2 format that allows compression of ctrl/diff/extra streams with different algorithms. The compression algorithm supported for now is bz2 and brotli. This new format is similar to the legacy "BSDIFF40" format except for the magic headers. File format: 0 8 magic header 8 8 X 16 8 Y 24 8 new_file_size 32 X compressed control block 32+X Y compressed diff block 32+X+Y ??? compressed extra block The magic header for BSDF2 format: 0 5 BSDF2 5 1 compressed type for control stream 6 1 compressed type for diff stream 7 1 compressed type for extra stream Bug: 34220646 Test: unittest pass Change-Id: I6eb0867e88476dbc4a4b7be609783f8c8a0a41cd
Diffstat (limited to 'bz2_compressor.h')
-rw-r--r--bz2_compressor.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/bz2_compressor.h b/bz2_compressor.h
index b6f4dfe..5e2e9f6 100644
--- a/bz2_compressor.h
+++ b/bz2_compressor.h
@@ -29,6 +29,7 @@ class BZ2Compressor : public CompressorInterface {
bool Write(const uint8_t* buf, size_t size) override;
bool Finish() override;
const std::vector<uint8_t>& GetCompressedData() override;
+ CompressorType Type() override { return CompressorType::kBZ2; }
private:
// The low-level bzip2 stream.