Add support for binary compression of dynamic patches by the flutter tool. (#27754)

This reduces the typical dynamic patch size by more than 10x.

Also see https://github.com/flutter/engine/pull/7777 for decompression support in the runtime.
This commit is contained in:
Stanislav Baranov
2019-02-11 16:57:26 -08:00
committed by GitHub
parent 8101862bdb
commit b47da6c2b7
3 changed files with 476 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:typed_data';
import 'package:flutter_tools/src/base/bsdiff.dart';
import '../src/common.dart';
void main() {
group('Main', () {
test('generates diff', () {
final Uint8List a = Uint8List.fromList('Hello'.runes.toList());
final Uint8List b = Uint8List.fromList('World'.runes.toList());
final Uint8List c = Uint8List.fromList(bsdiff(a, b));
expect(bspatch(a, c), equals(b));
});
});
}