mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-07 04:32:18 +00:00
Improve zopfli encoder
Write in chunks for CLI compression
This commit is contained in:
@@ -50,8 +50,8 @@ public:
|
||||
bool write(const void *buf, size_t len) final;
|
||||
|
||||
protected:
|
||||
// Classes inheriting this class has to call close() in its destructor
|
||||
void close();
|
||||
// Classes inheriting this class has to call finalize() in its destructor
|
||||
void finalize();
|
||||
virtual bool write_chunk(const void *buf, size_t len) = 0;
|
||||
|
||||
size_t chunk_sz;
|
||||
|
||||
@@ -140,7 +140,7 @@ bool chunk_out_stream::write(const void *_in, size_t len) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void chunk_out_stream::close() {
|
||||
void chunk_out_stream::finalize() {
|
||||
if (buf_off) {
|
||||
write_chunk(_buf, buf_off);
|
||||
delete[] _buf;
|
||||
|
||||
Reference in New Issue
Block a user